Closed njtierney closed 6 years ago
This change implements a flexible way to specify new, special missing values, as described in #50 and related issues.
Fixes #50
library(naniar) df <- tibble::tribble( ~wind, ~temp, -99, 45, 68, NA, 72, 25 ) dfs <- bind_shadow(df) dfs #> # A tibble: 3 x 4 #> wind temp wind_NA temp_NA #> <dbl> <dbl> <fct> <fct> #> 1 -99 45 !NA !NA #> 2 68 NA !NA NA #> 3 72 25 !NA !NA recode_shadow(dfs, temp = .where(wind == -99 ~ "bananas")) #> # A tibble: 3 x 4 #> wind temp wind_NA temp_NA #> <dbl> <dbl> <fct> <fct> #> 1 -99 45 !NA NA_bananas #> 2 68 NA !NA NA #> 3 72 25 !NA !NA recode_shadow(dfs, temp = .where(wind == -99 ~ "bananas")) %>% recode_shadow(wind = .where(wind == -99 ~ "apples")) #> # A tibble: 3 x 4 #> wind temp wind_NA temp_NA #> <dbl> <dbl> <fct> <fct> #> 1 -99 45 NA_apples NA_bananas #> 2 68 NA !NA NA #> 3 72 25 !NA !NA
Created on 2018-08-20 by the reprex package (v0.2.0).
Yes, many tests have been added
NEWS and Description have been updated
Description
This change implements a flexible way to specify new, special missing values, as described in #50 and related issues.
Related Issue
Fixes #50
Example
Created on 2018-08-20 by the reprex package (v0.2.0).
Tests
Yes, many tests have been added
NEWS + DESCRIPTION
NEWS and Description have been updated