Description Usage Arguments Author(s) Examples
This function is used to extract a date from a character
vector, using a
user-provided date parser. It first uses regular expressions to isolate
potential dates from the character strings, and then applies the parser (by
default, lubridate::ymd
) to return a Date
object. The function only
handles dates provided as numbers.
1 | extract_date(x, date_parser = lubridate::ymd)
|
x |
a |
date_parser |
a function to extract dates from character strings; we
recommend using |
Thibaut Jombart thibautjombart@gmail.com
1 2 3 4 5 | x <- c("contacts_2017-10-29.xlsx",
"some text! 2020 01 12",
"2019.1.13 - linelist",
"no date here :-/ ")
extract_date(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.