[R] cumsum on chron objects

From: Sebastian Luque <sluque_at_mun.ca>
Date: Wed 18 May 2005 - 08:49:18 EST


Is there some alternative to cumsum for chron objects? I have data frames that contain some chron objects that look like this:

13/10/03 12:30:35
15/10/03 16:30:05


and I've been trying to replace the NA's so that a date/time sequence is created starting with the preceding available value. Because the number of rows with NA's following each available date/time is unknown, I've split the data frame using:

splitdf <- split(df, as.factor(df$DateTime))

so that I can later use lapply to work on each "block" of data. I thought I could use cumsum and set the NA's to the desired interval to create the date/time sequence starting with the first row. However, this function is not defined for chron objects. Does anybody know of alternatives to create such a sequence?

Thanks in advance,

Sebastian P. Luque

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Wed May 18 09:00:01 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:50 EST