str_coll | R Documentation |
Take the elements of multiple vectors and concatenate them into one long string.
str_coll(..., wrap = "", between = ",", unique = FALSE)
... |
(...) Vectors that will be concatenated and coerced to Character. |
wrap |
(Character) Placed at the left and right sides of each vector element. |
between |
(Character) Placed between each element of the original vector(s). |
unique |
(Logical) If |
A string.
Desi Quintans (http://www.desiquintans.com)
## Not run:
vec <- c("Gum", "Rock", "Pen", "Bottle", "Pen")
str_coll(vec)
#> [1] "Gum,Rock,Pen,Bottle,Pen"
str_coll(vec, wrap = "-", between = ", ")
#> [1] "-Gum-, -Rock-, -Pen-, -Bottle-, -Pen-"
str_coll(vec, wrap = "-", between = ", ", unique = TRUE)
#> [1] "-Gum-, -Rock-, -Pen-, -Bottle-"
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.