powered by
Inserts * between variables in a term where it may have been omitted.
*
format_qca_term(term, var_names, use_tilde = TRUE)
Character. The formatted term with * between all variables.
Character. A single term (e.g., "KSPRVT" or "~KPR*PRD").
Character vector. Variable names used in the analysis.
Logical. If TRUE, negation is represented as ~VAR. If FALSE, negation is represented as lowercase (e.g., var).
~VAR
var
var_names <- c("KSP", "KPR", "PRD", "RVT", "RCM") format_qca_term("KSPRVTRCM", var_names) # Returns: "KSP*RVT*RCM" format_qca_term("~KPRPRD", var_names) # Returns: "~KPR*PRD"
Run the code above in your browser using DataLab