View source: R/replace_number.R
replace_number | R Documentation |
Replaces numeric represented numbers with words (e.g., 1001 becomes one thousand one).
replace_number(text.var, num.paste = TRUE, remove = FALSE)
text.var |
The text variable. |
num.paste |
logical. If |
remove |
logical. If |
Returns a vector with abbreviations replaced.
The user may want to use replace_ordinal
first to
remove ordinal number notation. For example replace_number
would turn "21st" into "twenty onest", whereas replace_ordinal
would generate "twenty first".
Fox, J. (2005). Programmer's niche: How do you spell that number? R News. Vol. 5(1), pp. 51-55.
bracketX
,
qprep
,
replace_abbreviation
,
replace_contraction
,
replace_symbol
,
replace_ordinal
## Not run:
x <- c("I like 346,457 ice cream cones.", "They are 99 percent good")
y <- c("I like 346457 ice cream cones.", "They are 99 percent good")
replace_number(x)
replace_number(y)
replace_number(x, FALSE)
replace_number(x, remove=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.