Description Usage Arguments Value Note See Also Examples
A wrapper for gsub
that takes a
vector of search terms and a vector or single value of
replacements.
1 2 3 4 5 6 7 |
pattern |
Character string to be matched in the given character vector. |
replacement |
Character string equal in length to pattern or of length one which are a replacement for matched pattern. |
text.var |
The text variable. |
leadspace |
logical. If TRUE inserts a leading space in the replacements. |
trailspace |
logical. If TRUE inserts a trailing space in the replacements. |
fixed |
logical. If TRUE, pattern is a string to be matched as is. Overrides all conflicting arguments. |
... |
Additional arguments passed to
|
Returns a vector with the pattern replaced.
The replacements occur sequentially rather than all at once. This means a previous (first in pattern string) sub could alter a later sub.
1 2 3 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.