Description Usage Arguments Details Value Examples
View source: R/str_replace_us.R
Vectorised over string, to replace underscores with spaces or vice versa.
1 2 3 | str_replace_us(string)
str_replace_sp(string)
|
string |
"Input vector. Either a character vector, or something coercible to one." (from |
These two functions are thin wrappers around str_replace_all()
from the 'stringr' package.
They just pass a space (" "
) or an underscore ("_"
) to the parameters pattern
and replacement
, automatically.
(Yes, I do this often enough to warrant adding two new functions to my namespace!)
"A character vector." (from ?stringr::str_replace_all
)
1 2 3 4 5 | txt <- "This_is_a_string"
str_replace_us(txt)
txt <- "This is a string"
str_replace_sp(txt)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.