x <- yearmon(2000 + seq(0, 23)/12)
x
# returned Date is the fraction of the way through
# the period given by frac (= 0 by default)
as.Date(x)
as.Date(x, frac = 1)
as.POSIXct(x)
z <- zoo(rnorm(24), x, frequency = 12)
z
as.ts(z)
Run the code above in your browser using DataLab