Common formula-based interface shared by multiple functions.
Arguments
- formula
A formula of the form
lhs ~ rhs, wherelhsgives the response values andrhsthe corresponding groups or explanatory variables.- data
an optional matrix or data frame (or similar; see
stats::model.frame()) containing the variables in the formula. By default the variables are taken fromenvironment(formula).- subset
an optional vector specifying a subset of observations to be used in the analysis.
- na.action
A function which indicates what should happen when the data contain
NAs. Defaults togetOption("na.action").
Details
Formula interfaces are evaluated using stats::model.frame(),
following standard R conventions.
The left-hand side of the formula must contain the response variable.
The right-hand side typically specifies a grouping or explanatory variable.
Only formulas with a single response and at least one explanatory
variable are supported.
See also:
