Add special missing values to the shadow matrix
It can be useful to add special missing values, naniar supports this with
the recode_shadow
function.
recode_shadow(data, ...)
data |
data.frame |
... |
A sequence of two-sided formulas as in dplyr::case_when,
but when a wrapper function |
a dataframe with altered shadows
df <- tibble::tribble( ~wind, ~temp, -99, 45, 68, NA, 72, 25 ) dfs <- bind_shadow(df) dfs recode_shadow(dfs, temp = .where(wind == -99 ~ "bananas")) recode_shadow(dfs, temp = .where(wind == -99 ~ "bananas")) %>% recode_shadow(wind = .where(wind == -99 ~ "apples"))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.