Re: [R] Changing ts times to dates

2009-07-23 Thread Gabor Grothendieck
You may need to modify this slightly depending on the specifics of the fraction calculation but try this to get started: x <- 2009.004 dt <- as.Date(paste(floor(x) + 0:1, 1, 1, sep = "-")) dt[1] + as.numeric(diff(dt)) * (x %% 1) - 1 # 2009-01-01 On Thu, Jul 23, 2009 at 11:48 AM, Chuse chuse wro

[R] Changing ts times to dates

2009-07-23 Thread Chuse chuse
Dear all, Ive just started with R and I have question: how can you change a time from a ts object .i.e 2009.004 to "2009-01-01"? Is there any function for this? I tried around with as.Date... but it hasnt worked. Thank you beforehand. Chuse. [[alternative HTML version deleted]]