Allow to work with model frames for 'timeSeries' objects.
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
the argument data was not a
data.frame but also an object of
Returns an object of class 'timeSeries.
This function is preliminary and untested.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.