Learn R Programming

qdap (version 0.2.5)

replace_number: Replace Numbers With Text Representation

Description

Replaces numeric represented numbers with words (e.g., 1001 becomes one thousand one).

Usage

replace_number(text.var, num.paste = "separate")

Arguments

text.var
The text variable.
num.paste
A character vector of either "separate" or "combine". Of "separate" is specified the elements of larger numbers are separated with spaces. If "combine" is selected the elements will be join

Value

  • Returns a vector with abbreviations replaced.

References

Fox, J. (2005). Programmer's niche: How do you spell that number? R News. Vol. 5(1), pp. 51-55.

See Also

bracketX, qprep, replace_abbreviation, replace_contraction, replace_symbol

Examples

Run this code
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, "combine")

Run the code above in your browser using DataLab