Convert input in month-day-year format to date

as_mdy(x)

Arguments

x

Input variable

Value

Date variable of class Date

Details

Use as.character if x is a factor

Examples

as_mdy("2-1-2014")
#> [1] "2014-02-01"
if (FALSE) { as_mdy("2-1-2014") %>% month(label = TRUE) as_mdy("2-1-2014") %>% week() as_mdy("2-1-2014") %>% wday(label = TRUE) }