replace_number(text.var, num.paste = TRUE, remove = FALSE)
TRUEa the elements of larger numbers are separated with spaces. If
FALSEthe elements will be joined without spaces.
TRUEnumbers are removed from the text.
Returns a vector with abbreviations replaced.
Replaces numeric represented numbers with words (e.g., 1001 becomes one thousand one).
The user may want to use
replace_ordinal first to
remove ordinal number notation. For example
would turn "21st" into "twenty onest", whereas
would generate "twenty first".
Fox, J. (2005). Programmer's niche: How do you spell that number? R News. Vol. 5(1), pp. 51-55.
## <strong>Not run</strong>: # 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) # ## <strong>End(Not run)</strong>