combine()
acts like c()
or
unlist()
but uses consistent dplyr coercion rules.
If combine()
it is called with exactly one list argument, the list is
simplified (similarly to unlist(recursive = FALSE)
). NULL
arguments are
ignored. If the result is empty, logical()
is returned.
Use vctrs::vec_c()
if you never want to unlist.
combine(...)
... | Vectors to combine. |
---|
bind_rows()
and bind_cols()
in bind.
# combine applies the same coercion rules as bind_rows() f1 <- factor("a") f2 <- factor("b") c(f1, f2)#> [1] 1 1#> [1] a b #> Levels: a bcombine(f1, f2)#> Warning: Unequal factor levels: coercing to character#> Warning: binding character and factor vector, coercing into character vector#> Warning: binding character and factor vector, coercing into character vector#> [1] "a" "b"#> Warning: Unequal factor levels: coercing to character#> Warning: binding character and factor vector, coercing into character vector#> Warning: binding character and factor vector, coercing into character vector#> [1] "a" "b"