Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stats-model.frame

Model Frames for Time Series Objects


Description

Allow to work with model frames for 'timeSeries' objects.

Details

The function model.frame is a generic function which returns in the R-ststs framework by default a data.frame with the variables needed to use formula and any ... arguments. In contrast to this the method returns an object of class timeSeries when the argument data was not a data.frame but also an object of class 'timeSeries'.

Value

Returns an object of class 'timeSeries.

Note

This function is preliminary and untested.

See Also

Examples

## Load Microsoft Data -
   setRmetricsOptions(myFinCenter = "GMT")
   X <- MSFT[1:12, ]

## Extract High's and Low's:
   DATA <- model.frame( ~ High + Low, data = X)
   class(DATA)
   as.timeSeries(DATA)
   
## Extract Open Prices and their log10's:
   base <- 10
   Open <- model.frame(Open ~ log(Open, base = `base`), data = X)
   colnames(Open) <- c("X", "log10(X)")
   class(Open)
   as.timeSeries(Open)

timeSeries

Financial Time Series Objects (Rmetrics)

v3062.100
GPL (>= 2)
Authors
Diethelm Wuertz [aut] (original code), Tobias Setz [cre], Yohan Chalabi [ctb], Martin Maechler [ctb] (<https://orcid.org/0000-0002-8685-9910>)
Initial release
2020-01-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.