| series-methods {timeSeries} | R Documentation |
Get and set the data component of a 'timeSeries'
Description
Get and set the data component of a 'timeSeries'.
Usage
series(x)
series(x) <- value
Arguments
x |
a |
value |
a |
Details
series returns the @.Data slot of a timeSeries
object in matrix form.
The assignment version of series replaces the values of the
time series with value. The row and column names of
value are used if not NULL, otherwise they are left as
in x. The most natural use is when value has the same
dimensions as as.matrix(x), but if that is not the case the
result is almost as if value was converted to
"timeSeries" directly.
coredata and its assignment counterpart are equivalent
alternatives to series and its assignment part, respectively.
See Also
Examples
## A Dummy 'timeSeries' Object
ts <- timeSeries()
ts
## Get the Matrix Part -
mat <- series(ts)
class(mat)
mat
## Assign a New Univariate Series -
series(ts) <- rnorm(12)
ts
## Assign a New Bivariate Series -
series(ts) <- matrix(rnorm(12), ncol = 2)
ts
[Package timeSeries version 4030.106 Index]