View source: R/fix_date_char.R
fix_date_char | R Documentation |
Converts a character vector (or single character object) from improperly
formatted dates to R's Date class. Supports numerous separators including
/, -, or white space. Supports all-numeric, abbreviation or long-hand month
notation. Where day of the month has not been supplied, the first day of the
month is imputed by default. Either DMY or YMD is assumed by default.
However, the US system of MDY is supported via the format
argument.
fix_date_char(
dates,
day.impute = 1,
month.impute = 7,
format = "dmy",
excel = FALSE,
roman.numeral = FALSE
)
A vector of elements belonging to R's built in Date
class
with the following format yyyy-mm-dd
.
fix_date_df
which is similar to fix_date_char()
except is applicable to columns of a data frame.
bad.date <- "02 03 2021"
fixed.date <- fix_date_char(bad.date)
fixed.date
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.