as.matrix.ts {fUtilities}R Documentation

Convert Time Series to Matrix

Description

Creates a matrix from the given "ts" or "mts" time series objects, a method missing in R's base package.

Usage

## S3 method for class 'ts':
as.matrix(x, ...)
## S3 method for class 'mts':
as.matrix(x, ...)

Arguments

x an univariate or multivariate time series object of class "ts" or "mts" which will be transformed into an one-column or multi-column rectangular object of class "matrix".
... arguments to be passed.

Examples

## as.matrix -
   z <- ts(matrix(rnorm(300), 100, 3), start=c(1961, 1), frequency=12)
   class(z)
   z
   as.matrix(z)

[Package fUtilities version 270.73 Index]