Description Usage Arguments Note Examples
View source: R/replace_ordinal.R
Replaces mixed text/numeric represented ordinal numbers with words (e.g., "1st" becomes "first").
1 | replace_ordinal(x, num.paste = FALSE, remove = FALSE, ...)
|
x |
The text variable. |
num.paste |
logical. If |
remove |
logical. If |
... |
ignored. |
Currently only implemented for ordinal values 1 through 100
1 2 3 4 5 6 7 8 | x <- c(
"I like the 1st one not the 22nd one.",
"For the 100th time stop!"
)
replace_ordinal(x)
replace_ordinal(x, TRUE)
replace_ordinal(x, remove = TRUE)
replace_number(replace_ordinal("I like the 1st 1 not the 22nd 1."))
|
[1] "I like the first one not the twenty second one."
[2] "For the hundredth time stop!"
[1] "I like the first one not the twentysecond one."
[2] "For the hundredth time stop!"
[1] "I like the one not the one." "For the time stop!"
[1] "I like the first one not the twenty second one."
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.