applyString | R Documentation |
Apply a function on a given set of elements of a character string.
applyString(x, FUN, pos = NULL, pattern = NULL)
x |
a character vector, or a vector to be coerced to a character vector. |
FUN |
the function to be applied, see |
pos |
a vector indicating the elements position. |
pattern |
a pattern see |
A character vector.
In case both pos
or pattern
, the latter is ignored.
applyString('cool', pos = 1:2, FUN = toupper) applyString(c('cool', 'pro'), pattern = 'o', FUN = toupper)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.