# NOT RUN {
# coerce dates to yearmonth, yearquarter ----
x <- seq(as.Date("2016-01-01"), as.Date("2016-12-31"), by = "1 month")
yearmonth(x)
yearquarter(x)
# coerce numerics to yearmonth, yearquarter ----
yearmonth(seq(2010, 2017, by = 1 / 12))
yearquarter(seq(2010, 2017, by = 1 / 4))
# coerce yearmonths to yearquarter ----
y <- yearmonth(x)
yearquarter(y)
# }
Run the code above in your browser using DataLab