R/ym.R
date_to_ym.Rd
Date to period string
date_to_ym(d = as.Date(c("2009-02-01", "2019-12-01")))
yyyy-mm-dd or any valid date or string coercible to date
dtp <- date_to_ym(as.Date(c("2009-02-01", "2019-12-01"))) dtp #> [1] "200902" "201912" class(dtp) #> [1] "character"