[R] understanding time series objects
zeileis at ci.tuwien.ac.at
Fri Aug 8 14:07:45 CEST 2003
On Friday 08 August 2003 12:46, Angel wrote:
> ### First, is there a way to access a univariate time series as a
> matrix instead of a vector?
> # For example:
> # If I do
> # Gives an error as mdeaths is not a matrix but a vector,
Yes, a single time series in R is essentially a vector plus the time
series properties. Therefore, it can be accessed like a vector.
> when I look at it :
> # the ts object has a matrix like "appearance"
That is a print option that can be turned off, look at
> # The only way of doing it I've found is:
> # It is not very efficient to solve the problem of applying a
> cummulative sum to each year
> ### Second, for a multivariate ts:
> Multits<-ts.union(mdeaths, fdeaths)
> # Why does
> # not work and I have to use:
> # Is it the way it works or am I missing something?
A multivariate time series ("mts" object) is essentially a matrix plus
time series properties. Therefore, it can be accessed like a matrix
(and not like a data.frame/list).
> # Thanks as always,
> # Angel
> R-help at stat.math.ethz.ch mailing list
More information about the R-help