Description Usage Arguments Details Examples
Flatten list of strings of comma-separated elements
1 | flatten_csv(x, sep = ",", fixed = TRUE)
|
x |
Character vector of strings of separated elements |
sep |
Separator used to separate elements |
fixed |
If TRUE (default), separator is interpreted as a constant string, otherwise it is considered a regular expression in perl flavor |
The separator can also be an arbitrary perl regular expression in
which case ‘fixed’ should be set to FALSE
.
1 2 | stopifnot(all(1:5 == flatten_csv(c("1,2", "3,4,5"))))
stopifnot(all(c("a", "b", "c", "d") == flatten_csv(c("a1b", "c23d"), sep = "\\d+", fixed = FALSE)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.