Re: [R] Combine univariate time series

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Wed 13 Apr 2005 - 22:01:06 EST

On 4/13/05, Joerg Klausen <Joerg.Klausen@empa.ch> wrote:
> Hallo everyone
>
> I have two univariate time series (class ts) describing the same variable. They have the same resolution, but span different periods in time with a big gap in between. I need to append one to the other such that they are one object, with the gap filled with NAs. The method ts.union produces a multivariate time series where the time axis is correct, but the individual time series are not combined into one.
>

If ts1 and ts2 are two ts series:

both <- ts.union(ts1, ts2)
pmax(both[,1], both[,2], na.rm = TRUE)



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 Apr 13 22:08:16 2005

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