| model.frame {base} | R Documentation |
Extracting the “Environment” of a Model Formula
Description
model.frame (generic function) and its methods return a
data.frame with the variables from formula.
Usage
model.frame(formula, ...)
model.frame.default(formula, data = parent.frame(),
subset = NULL, na.action,
drop.unused.levels = FALSE, xlev = NULL, ...)
Methods for
lm glm aovlist
Arguments
formula |
a model formula |
data |
|
subset |
a specification of the rows to be used. Defaults to all rows. |
na.action |
how |
drop.unused.levels |
should factors have unused levels dropped?
Defaults to |
xlev |
a named list of character vectors giving the full set of levels to be assumed for each factor. |
... |
further arguments such as |
Value
A data.frame containing the variables used in
formula.
See Also
model.matrix for the “design matrix”,
formula for formulas and
expand.model.frame for model.frame manipulation.
Examples
data(cars)
data.class(model.frame(dist ~ speed, data = cars))