Skip to content
Prev 167725 / 398502 Next

timeSeries and aggregation() question

Hello,

I've a time series, T, for an irregular sequence of days (data for bank
holidays weekends have been removed).  I would like to aggregate this series
by into weeks using

aggregate(x, by="weeks", FUN=mean).

To do this, I think that x needs to be a timeSeries object, and when I try
to call

timeSeries(data=T, positions=irregular.sequence.of.days)

I get lots of NAs in the resulting object.  (Note: I've checked that
length(T)=length(irregular.sequence of days).  My dates are of the form
dd/mm/yyyy in case it's relevant.)  

Thanks in advance!