Description Usage Arguments Value See Also Examples
Replace names using a pattern.
Calls stringr::str_replace_all()
.
1 | replace_names(x, pattern, replacement, ...)
|
x |
a named object |
pattern |
regex pattern |
replacement |
replacement |
... |
Arguments passed on to
|
x with replaced names.
1 2 3 | fruits <- c(one = "one apple", two = "two pears", three = "three bananas")
replace_names(fruits, '^([a-z])', 'fruit_\\1')
replace_names(fruits, '^([a-z])', toupper)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.