getvariables | R Documentation |
getvarnames
extracts the variables' names
occurring in a formula, in raw form
(as get\_all\_vars
) or in transformed form
(as model.frame
does it).
getvariables
collects variables from a data.frame
getvariables(formula, data = NULL, transformed = TRUE,
envir = parent.frame(), ...)
getvarnames(formula, data = NULL, transformed = FALSE)
formula |
a model 'formula' or 'terms' object or an R object, or a character vector of variable names |
data |
a data.frame, list or environment (or object coercible by 'as.data.frame' to a data.frame), containing the variables in 'formula'. Neither a matrix nor an array will be accepted. |
transformed |
logical. If |
envir |
environment in which the |
... |
further arguments such as
|
For getvarnames
:
names of all variables (transformed=FALSE
)
or simple terms (transformed=TRUE
),
including the attributes
xvar |
those from the right hand side of the formula |
yvar |
left hand side, if present |
yvar |
conditioning part, denoted after a |
For getvariables
:
data.frame containing the extracted variables or simple terms,
with the attributes of getvarnames
Werner A. Stahel
model.frame
, get_all_vars
data(d.blast)
getvarnames(log10(tremor)~log10(distance)*log10(charge), data=d.blast)
dd <- getvariables(log10(tremor)~log10(distance)*log10(charge),
data=d.blast, by=location)
str(dd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.