Learn R Programming

equatiomatic (version 0.1.0)

detect_primary: Detect if a given term is part of a vector of full terms

Description

Detect if a given term is part of a vector of full terms

Usage

detect_primary(full_term, primary_term_v)

Arguments

full_term

The full name of a single term, e.g., "partyidOther party"

primary_term_v

A vector of primary terms, e.g., "partyid". Usually the result of formula_rhs[!grepl(":", formula_rhs)]

Value

A logical vector the same length of primary_term_v indicating whether the full_term is part of the given primary_term_v element

Examples

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