Learn R Programming

TSQCA (version 1.0.0)

format_qca_term: Format a single QCA term

Description

Inserts * between variables in a term where it may have been omitted.

Usage

format_qca_term(term, var_names, use_tilde = TRUE)

Value

Character. The formatted term with * between all variables.

Arguments

term

Character. A single term (e.g., "KSPRVT" or "~KPR*PRD").

var_names

Character vector. Variable names used in the analysis.

use_tilde

Logical. If TRUE, negation is represented as ~VAR. If FALSE, negation is represented as lowercase (e.g., var).

Examples

Run this code
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