[R] convert zoo object to "standard" R object so I can plot and output to csv file

Henry hccoles at lbl.gov
Thu Feb 23 03:54:25 CET 2012

Thanks very much.
I have all the zoo functions to get 1 minute aggregation and 15 min. means
working and now able to write out to a file/etc.

One question on the 15 min. mean results.

m1 <- times("00:01:00")
g <- seq(trunc(start(z),m1),end(z),by = m1)
z1<-na.approx(z,xout = g)
m15 <- times("00:15:00")
ag15 <- aggregate(z1,trunc(time(z1),m15),mean)

Does the value of ag15 get assigned to the "center" of the time, front or
Can this be defined?
It seems aggregate(z1,trunc(time(z1),m15),mean) is getting the mean and
"assigning" it to the first time stamp, not a time stamp assigned to 7.5
minutes from the first 1 minute data point used to get the mean.

Is there an option to "create" a new regular timestamp on 15 periods but
centered or reporting on 7.5 minute periods?


View this message in context: http://r.789695.n4.nabble.com/convert-zoo-object-to-standard-R-object-so-I-can-plot-and-output-to-csv-file-tp4398302p4412622.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list