Re: [R] Conversion a ts time to another class.

2009-07-27 Thread jim holtman
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',

[R] Conversion a ts time to another class.

2009-07-27 Thread Chuse chuse
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