Description Usage Arguments Value Examples
convert string into a vector of each char
1 | str_to_char(x, unique = F, sort = F, ...)
|
x |
a string or a vector of strings. Note if a vector supplied, it will be collapsed. If you wanna multiple vectors of char returned, you can use sapply() to wrapper the function. |
unique |
If 'TRUE' chars should be uniqued, otherwise as it is. |
sort |
If 'TRUE' chars should be sorted by alphabetic, otherwise as it is. |
... |
more parameters to be used in sort(). such as order decreasing = T if you like. |
a vector of chars
1 2 3 | str_to_char(x = c("Here it is"), unique = F, sort = F)
str_to_char(x = c("Yes", "or", "Not"), unique = F, sort = F)
sapply(c("Yes", "or", "Not"), str_to_char, sort = F, unique = F)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.