table(fct_match(gss_cat$marital, c("Married", "Divorced")))
# Compare to %in%, misspelled levels throw an error
table(gss_cat$marital %in% c("Maried", "Davorced"))
if (FALSE) {
table(fct_match(gss_cat$marital, c("Maried", "Davorced")))
}
Run the code above in your browser using DataLab