powered by
Extracts individual terms from solution expressions and returns formatted unique terms.
extract_terms(solutions, var_names, use_tilde = TRUE)
List with:
all_terms — all terms (with duplicates)
all_terms
unique_terms — unique terms
unique_terms
n_total — total term count
n_total
n_unique — unique term count
n_unique
Character vector. Solution expressions.
Character vector. Variable names used in the analysis.
Logical. If TRUE, negation is represented as ~VAR.
~VAR
var_names <- c("X1", "X2", "X3") solutions <- c("X1*X2 + X3", "X1*X2 + X1*X3") extract_terms(solutions, var_names)
Run the code above in your browser using DataLab