Combine all arguments into a new vector of common type.
vec_c(..., .ptype = NULL)
... | Vectors to coerce. |
---|---|
.ptype | If Alternatively, you can supply |
A vector with class given by .ptype
, and length equal to the
sum of the vec_size()
of the contents of ...
.
The vector will have names if the individual components have names
(inner names) or if the arguments are named (outer names). If both
inner and outer names are present, they are combined with a .
.
vec_size(vec_c(x, y)) == vec_size(x) + vec_size(y)
vec_type(vec_c(x, y)) == vec_type_common(x, y)
.
vec_cbind()
/vec_rbind()
for combining data frames by rows
or columns.
vec_c(FALSE, 1L, 1.5)#> [1] 0.0 1.0 1.5#> [1] "FALSE" "1" "x"#> [1] "2019-02-18" "4247183-09-30"#> [1] "2019-02-18 23:28:01 UTC" "1970-01-01 04:59:05 UTC"#> [1] "2019-02-18 00:00:00 UTC" "2019-02-18 23:28:01 UTC"#> [1] "2019-02-18 23:28:01 UTC" "2019-02-18 00:00:00 UTC"#> [1] 1 1#> [1] a b #> Levels: a b