powered by
Detect if a given term is part of a vector of full terms
detect_primary(full_term, primary_term_v)
The full name of a single term, e.g., "partyidOther party"
"partyidOther party"
A vector of primary terms, e.g., "partyid". Usually the result of formula_rhs[!grepl(":", formula_rhs)]
"partyid"
formula_rhs[!grepl(":", formula_rhs)]
A logical vector the same length of primary_term_v indicating whether the full_term is part of the given primary_term_v element
primary_term_v
full_term
# NOT RUN { detect_primary("partyidStrong republican", c("partyid", "age", "race")) detect_primary("age", c("partyid", "age", "race")) detect_primary("raceBlack", c("partyid", "age", "race")) # }
Run the code above in your browser using DataLab