Description Usage Arguments Details Value Examples
Convert a string into list, given separators.
1 | chr_to_list(chr, atom_sep = ";", list_sep = "|")
|
chr |
string to convert. |
atom_sep |
separator for the elements of atomic vectors. |
list_sep |
separator for the elements of lists. |
The function is vectorized hence chr
can be
a character vector with more than one element. Consequently
the returned value is always a list (even of length 1).
If all elements of the returned list are atomic,
the list is simplified.
A list (NULL
if the string is empty or NA
).
1 2 3 4 5 | chr_to_list("1;2;3|a;b")
chr_to_list("1;2;3")
chr_to_list("1|2|3")
chr_to_list(c("1;3", "2|4")) # vectorized usage
chr_to_list(c("1;3", "2;4")) # simplification
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.