Re: [R] Help with creating date as POSIXct

2011-09-01 Thread jim holtman
try this: > myDate <- as.POSIXct(day, format = "%y%m%d") > myDate [1] "2011-08-09 EDT" > myDate <- myDate + 0:3600 > str(myDate) POSIXct[1:3601], format: "2011-08-09 00:00:00" "2011-08-09 00:00:01" "2011-08-09 00:00:02" ... > On Thu, Sep 1, 2011 at 7:18 AM, J. Augusiak wrote: > Dear list, > > >

Re: [R] Help with creating date as POSIXct

2011-09-01 Thread Luke Miller
This should be due to the fact that "110809 60 0" is not interpreted as a valid time value. You probably want to have time.t <- 0:3599 rather than time.t <- 1:3600 if you want one value for each second in the hour, starting from 00:00:00 and running to 00:59:59. 00:60:00 is not a proper time val

[R] Help with creating date as POSIXct

2011-09-01 Thread J. Augusiak
Dear list, I want to create a POSIX time vector as follows: day<- as.character("110809") time.t <- 1:3600 t.min <- time.t %/% 60 t.sec <- time.t-t.min*60 DATE <- as.POSIXct(strptime(paste(day,t.min,t.sec),"%y%m%d %M%S")) Tail(DATE) The problem is that the last element (3