View source: R/prep_data_utils.R
convert_date_cols | R Documentation |
This function is called in prep_data
and so it
shouldn't usually need to be called directly. It tries to convert columns
ending in "DTS" to type Date or DateTime (POSIXt). It makes a best guess at
the format and return a more standard one if possible.
convert_date_cols(d)
d |
A dataframe or tibble containing data to try to convert to dates. |
A tibble containing the converted date columns. If no columns needed conversion, the original data will be returned.
d <- tibble::tibble(a_DTS = c("2018-3-25", "2018-3-25"), b_nums = c(2, 4), c_DTS = c("03-01-2018", "03-07-2018"), d_chars = c("a", "b"), e_date = lubridate::mdy(c("3-25-2018", "3-25-2018"))) convert_date_cols(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.