Description Usage Arguments Value Examples
Replaces dates with word equivalents.
1 | replace_date(x, pattern = NULL, replacement = NULL, ...)
|
x |
The text variable. |
pattern |
Character date 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 | x <- c(
NA, '11-16-1980 and 11/16/1980',
"and 2017-02-08 but then there's 2/8/2017 too"
)
replace_date(x)
replace_date(x, replacement = '<<DATE>>')
|
[1] NA
[2] "November sixteenth, one thousand nine hundred and eighty and November sixteenth, one thousand nine hundred and eighty"
[3] "and February eighth, two thousand and seventeen but then there's February eighth, two thousand and seventeen too"
[1] NA
[2] "<<DATE>> and <<DATE>>"
[3] "and <<DATE>> but then there's <<DATE>> too"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.