combine {dplyr}R Documentation

Combine vectors

Description

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.

Usage

combine(...)

Arguments

...

Vectors to combine.

Details

Questioning lifecycle

See Also

bind_rows() and bind_cols() in bind.

Examples

# combine applies the same coercion rules as bind_rows()
f1 <- factor("a")
f2 <- factor("b")
c(f1, f2)
unlist(list(f1, f2))

combine(f1, f2)
combine(list(f1, f2))

[Package dplyr version 0.8.5 Index]