x <- as.yearqtr(2000 + seq(0, 7)/4)
x
format(x, "%Y Quarter %q")
as.yearqtr("2001 Q2")
as.yearqtr("2001 q2") # same
as.yearqtr("2001-2") # same
# returned Date is the fraction of the way through
# the period given by frac (= 0 by default)
dd <- as.Date(x)
format.yearqtr(dd)
as.Date(x, frac = 1)
as.POSIXct(x)
zz <- zoo(rnorm(8), x, frequency = 4)
zz
as.ts(zz)
Run the code above in your browser using DataLab