[R] cumsum on chron objects

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


Hi,

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

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

NA
NA
...

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
https://stat.ethz.ch/mailman/listinfo/r-help
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