Description Usage Arguments Value Examples
Split strings by comma into character vector(s)
1 | cc(x, simplify)
|
x |
Vector of comma separated character strings |
simplify |
Logical indicating whether to return a character vector (the default) when the length of x is one. This argument does nothing if the length of x is greater than 1. |
If length of x is 1 then a character vector otherwise a list of character vectors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## comma separated alphabet
abcs <- paste(letters, collapse = ",")
## split single string
cc(abcs)
## return as list
cc(abcs, simplify = FALSE)
## select columns
mtcars[, cc("cyl,mpg,wt,gear")]
## character vector with multiple strings
x <- c("v1,v2,v3", "y1,y2,y5")
## convert strings into list of [split] character vectors
cc(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.