x.names.from.formula | R Documentation |
(Internal) Get names of explanatory variables (excluding random factor) from formula.
x.names.from.formula(
formula,
data = NULL,
specials = NULL,
type = c("all", "base")
)
formula |
a formula object from which variable names are obtained. |
data |
a data.frame used to expand . in the formula. |
specials |
special characterss passed to |
type |
a character literal specifying type of explanatory variables to get. |
a character vector of names of explanatory variables. If type is "all", returns all explanatory variables in the formula as is. If type is "base", this function returns all explanatory variables in their basic form.
# Getting explanatory variables from formula.
# . in formula is expanded to full form.
data(iris)
f <- Sepal.Length ~ .
model.adapter:::x.names.from.formula(f, data = iris)
# Getting explanatory variables in their basic form.
f <- Sepal.Length ~ Petal.Length + Petal.Length:Species + I(Sepal.Width ^ 2)
model.adapter:::x.names.from.formula(f, data = iris, type = "base")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.