Description Usage Arguments Details Value Examples
Takes a factor and converts "Don't know/Refused" responses to NA
.
Matches a variety of common patterns such as "Don't know", "Refused"s, "DK/Ref", etc.
1 2 3 4 5 |
f |
A factor variable. |
pattern |
A regular expression that matches factor levels to convert to NA. |
Make sure to tabulate the variable after running this function and check that levels weren't unintentionally removed.
The factor variable, with DK/Ref values set to NA.
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.