Description Usage Arguments Value Examples
View source: R/replace_money.R
Replaces money with word equivalents.
1 2 | replace_money(x, pattern = "(-?)([$])([0-9,]+)(\\.\\d{2})?",
replacement = NULL, ...)
|
x |
The text variable. |
pattern |
Character money regex string to be matched in the given character vector. |
replacement |
A function to operate on the extracted matches or a character string which is a replacement for the matched pattern. |
... |
ignored. |
Returns a vector with the pattern replaced.
1 2 3 4 5 6 7 8 | x <- c(
NA,
'$3.16 into "three dollars, sixteen cents"',
"-$20,333.18 too", 'fff'
)
replace_money(x)
replace_money(x, replacement = '<<MONEY>>')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.