collapse_vec: Collapse a vector

Description Usage Arguments Value Examples

View source: R/internal_functions.R

Description

I use this internally for turning a vector of package names into a string.

Usage

1
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 TRUE, duplicate entries in ... will be removed.

Value

A string.

Examples

1
2
3
4
5
## Not run: 
collapse_vec(month.abb)
#> [1] "'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'"

## End(Not run)

librarian documentation built on July 12, 2021, 5:07 p.m.