Description Usage Arguments Details Value Examples
Given a vector of character strings, substitute parts of the strings matching 'pattern' with 'replacement'. 'replacement' can be a vector argument, in which case it must be the same length as 'text', and the substiuted 'text' is made per 'replacement' string.
1 |
text |
a vector of character strings to have patterns substituted. |
pattern |
a string pattern that, if matched in 'text' will be substituded with 'replacement'. |
replacement |
either a string or vector of strings to replace matching patterns in 'text'. |
sub_all |
Determined if all matches are substited (default), or the first ocurrence per input string. |
The default mode is to substitute all pattern matches. This can be switched to first match only by setting 'sub_all = FALSE'.
a vector of character strings
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.