to_missind | R Documentation |
Returns the input dataframe with the target column recoded such that 0 = missing and 1 = present.
To facilitate a common task that would otherwise require a pattern like this:
df %>%
mutate(x = ifelse( ! is.na(x), 1, 0)) %>%
count(x)
to_missind(data, x)
data |
Dataframe |
x |
String indicating name of target column |
Note that despite the name "missingness indicator", a value of 1 = present.
to_missind(mice::boys, "bmi")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.