View source: R/cces_recode-outcome.R
yesno_to_binary | R Documentation |
Operationalizes outcomes of type yes/no to binary variables. It is internally given the values to count as a "Yes" by regular expression, e.g. not only "Yes" but also "Support" and "For"
yesno_to_binary(vec, DK_to_NA = TRUE)
vec |
A vector of CCES response values, in character |
DK_to_NA |
Whether don't knows should be treated as NA. Defaults to TRUE. |
A vector of integers
yesno_to_binary(
c("Yes",
"No",
"Support",
"Oppose",
"Somewhat support",
"Somewhat oppose",
"For this bill",
"Against this bill",
"Not sure",
"Don't Know",
NA_character_)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.