Description Usage Arguments Value Examples
Recode Missing Values Dictionary-Style
1 2 3 4 5 6 7 | dict_recode(
df,
use_func = "recode_na_as",
pattern_type = "starts_with",
patterns,
values
)
|
df |
A data.frame object for which recoding is to be done. |
use_func |
Function to use for the recoding. One of the various 'recode_*' functions in package 'mde'. |
pattern_type |
One of contains', 'starts_with' or 'ends_with'. |
patterns |
A vector containing patterns to use for pattern_type |
values |
A vector containing values to match to the patterns vector |
A 'data.frame' object with replacements as required.
1 2 3 4 5 6 | head(dict_recode(airquality, pattern_type="starts_with",
patterns = c("Solar", "Ozone"), values = c(190, 41),
use_func="recode_as_na"))
head(dict_recode(airquality, pattern_type="starts_with",
patterns = c("Solar", "Ozone"), values = c(42, 420),
use_func="recode_na_as"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.