ConvertNumerical2TSobject: Converts a Numerical to a Time Series Object

View source: R/ConvertNumerical2TSobject.R

ConvertNumerical2TSobjectR Documentation

Converts a Numerical to a Time Series Object

Description

Converts a numerical vector or matrix to a time series object of the stats package

Usage

ConvertNumerical2TSobject(NumericVectorOrMatrix, Time, 

Frequency = "days")

Arguments

NumericVectorOrMatrix

[1:n,1:d] matrix or vector with n cases and d variables

Time

[1:n] Time object of class Date

Frequency

either days, weeks, months or quarters or years

Details

shortcuts because several analytic methods require ts objects

Value

ts objects with [1:n,1:d]

Note

Internal Frequency of weekly data is estimated with 365.25/7 in the ts function.

Author(s)

Michael Thrun

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.

See Also

ts

Examples

tsobject=ConvertNumerical2TSobject(WeeklySalesUniformRandom$Sales,

WeeklySalesUniformRandom$Time,"weeks")

plot(tsobject)


Mthrun/TSAT documentation built on Feb. 5, 2024, 11:15 p.m.