Skip to content
Prev 67532 / 398506 Next

Combine univariate time series

On Wed, 13 Apr 2005, Joerg Klausen wrote:

            
Use window() to create an extended series, then indexing to insert the 
other in the correct place. E.g.

x1 <- ts(1:10, start=1900)
x2 <- ts(70:80, start=1970)
xx <- window(x1, end=1980, extend=TRUE)
xx[71:81] <- x2