Learn R Programming

timeSeries (version 3010.97)

model.frame: Model Frames for Time Series Objects

Description

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

Arguments

Value

  • an object of class timeSeries.

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.

See Also

model.frame.

Examples

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

## Extract High's and Low's:
   model.frame( ~ High + Low, data = X)
   
## 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)")
   Open

Run the code above in your browser using DataLab