bde_parse_dates | R Documentation |
This function is tailored for the date formatting used on this package, so it may fail if it is used for another datasets. See Examples for checking which formats would be considered.
FREQUENCY | FORMAT | EXAMPLES |
Daily / Business day | DD MMMMYYYY | 02 FEB2019 |
Monthly | MMM YYYY | MAR 2020 |
Quarterly | MMM YYYY, where MMM is the first or the last month of the quarter, depending on the value of its variable OBSERVED. | For the first quarter of 2020: ENE 2020, MAR 2020 |
Half-yearly | MMM YYYY, where MMM is the first or the last month of the halfyear period, depending on the value of its variable OBSERVED. | For the first half of 2020: ENE 2020, JUN 2020 |
Annual | YYYY | 2020 |
bde_parse_dates(dates_to_parse)
dates_to_parse |
Dates to parse |
Tries to parse strings representing dates using as.Date()
A Date
object.
as.Date()
# Formats parsed
would_parse <- c(
"02 FEB2019", "15 ABR 1890", "MAR 2020", "ENE2020",
"2020", "12-1993", "01-02-2014", "01/02/1990"
)
parsed_ok <- bde_parse_dates(would_parse)
class(parsed_ok)
tibble::tibble(raw = would_parse, parsed = parsed_ok)
#-----------------------------------
# Formats not admitted
wont_parse <- c("JAN2001", "2010-01-12", "01 APR 2017", "01/31/1990")
parsed_fail <- bde_parse_dates(wont_parse)
class(parsed_fail)
tibble::tibble(raw = wont_parse, parsed = parsed_fail)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.