try this:
> x <- 2009.004
> # get the number of days in the year
> days <- unclass(as.POSIXct(paste(floor(x)+1, "-1-1", sep='')) -
+ as.POSIXct(paste(floor(x), '-1-1', sep='')))
> # now compute the number of seconds from start of year
> current <- as.POSIXct(paste(floor(x), '-1-1',
Dear R collegues,
I am trying to change a ts time such as 2009.004 to a str or POSIX
class as "2009-01-01".
Is there any function or method to do it?. Thank you beforehand.
Chuse.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listin
2 matches
Mail list logo