[R] Merging Irregular Time Series With NAs

Gabor Grothendieck ggrothendieck at gmail.com
Tue Jun 23 16:10:52 CEST 2009


On Tue, Jun 23, 2009 at 10:04 AM, David Winsemius<dwinsemius at comcast.net> wrote:
>
> On Jun 23, 2009, at 9:50 AM, Gabor Grothendieck wrote:
>
>> Your zoo object is illegal since zoo objects are not supposed to
>> have duplicated times;
>
> They were unique at the sub-second level.
>
>> however, ignoring that if the object has
>> at most one NA in each row, which is the case in the example,
>> then this will produce a numeric vector and you can create a
>> new zoo object out of that:
>>
>>> rowSums(z, na.rm = TRUE)
>>
>> [1] 1.63755 1.63760 1.63760 1.63755 1.63755 1.63760
>
> But that will not give the desired answer if both aq$mid and d2$mid were
> present at the same time.

What was written was:
"if the object has at most one NA in each row, which is the case in
the example, ..."




More information about the R-help mailing list