[R] How to concatenate time series?

From: Robert Pollak <robert.pollak_at_scietec.at>
Date: Wed 16 Mar 2005 - 20:35:33 EST


Hello,

I have just completed first experiments in using R, especially creating and using ARIMA models, e.g.

# create a model as in example(arima)

fit <- arima(USAccDeaths, order = c(1,1,1),seasonal = list(order=c(1,1,1)))

# use the model to generate a prediction
dp<-predict(fit, n.ahead = 24)

plot(dp$pred) # view the prediction

Now I created a combined chart of the original and predicted values. I tried it like this:

dvs <- c(as.vector(USAccDeaths),as.vector(dp$pred)) plot(dvs, type="l")

Here, of course, the x axis does not display time values any more. So I manually recontructed a time series from the concatenated vector:

ds<-ts(dvs, 1973, 1980.91666666667, deltat = 1/12)

plot(ds) # this is the chart I wanted

Now my question is:
Is there some way to directly concatenate the original and the predicted time series? Searching the help files and this mailing list's archive gave me no hints.

Best regards,
Robert Pollak

-- 
______________________________________
Dipl.-Ing. Robert Pollak
SCIETEC Flussmanagement GmbH
Herrenstrasse 4
A-4020 Linz

Phone:      [+43] (0)732 / 71 31 20 26
Fax:        [+43] (0)732 / 71 31 20 4
Cell Phone: [+43] (0)699 / 11 44 30 32

Mailto: robert.pollak@scietec.at
URL:    http://www.scietec.at

______________________________________________
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 Mar 16 20:43:56 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:48 EST