collapse_vec {librarian} | R Documentation |
Collapse a vector
Description
I use this internally for turning a vector of package names into a string.
Usage
collapse_vec(..., wrap = "'", collapse = ", ", unique = TRUE)
Arguments
... |
(...) Vectors that will be concatenated and coerced to Character. |
wrap |
(Character) Placed at the left and right sides of each vector element. |
collapse |
(Character) Placed between each element of the original vector(s). |
unique |
(Logical) If |
Value
A string.
Examples
## Not run:
collapse_vec(month.abb)
#> [1] "'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'"
## End(Not run)
[Package librarian version 1.8.1 Index]