[R] Getting the last day of the month.

Jeffrey J. Hallman jhallman at frb.gov
Thu May 10 18:38:35 CEST 2007


The TimeIndex class in the 'fame' package handles this kind of stuff with ease.
> library(fame)
> ym <- 200212
> z <- lastDayOf(ti(100*ym + 1, tif = "monthly"))
> z
[1] 20021231
class: ti
> tifName(z)
[1] "daily"

a 'ti' object is a TimeIndex, and it has a tif (TimeIndexFrequency) embedded
in it. 
-- 
Jeff



More information about the R-help mailing list