Parse model formula, create new variables by evaluating expressions and return parsed names and new data frame. These elements are ment to be used by other functions.
parse_formula(formula, data = NULL, keep_all_vars = FALSE)
| formula | A
Variables can be expressed as function, e.g., |
|---|---|
| data | A data frame. |
| keep_all_vars | (logical) Flag indicating if all variables
(even those not in formula) should be included in the
output data.
Expression |
A list with fields:
formula - the formula used;
names - alist of character vectors with names in formula arranged in certain way (see below);
data - a data frame with variables and evaluated expressions in the formula and, optionally, with the remaining variables from the original data frame.
Contents of the field names:
all_names - all names (and expressions) in the formula;
y, x - names for "x" and "y" variables (except condition variables);
lhs, rhs - names in left-hand and right-hand side of formula (except condition variables);
condition - names of condition variables and expressions;
gr - if condition exists, gr is the same as condition, otherwise it is the same as x.