Shift the values, add shadow, add missing label

cast_shadow_shift_label(data, ...)

Arguments

data

data.frame

...

One or more unquoted expressions separated by commas. These also respect the dplyr verbs "starts_with", "contains", "ends_with", etc.

Value

data.frame with the shadow and shadow_shift vars, and missing labels

See also

Examples

airquality %>% cast_shadow_shift_label(Ozone)
#> # A tibble: 153 x 4 #> Ozone Ozone_NA Ozone_shift any_missing #> <int> <fct> <dbl> <chr> #> 1 41 !NA 41 Not Missing #> 2 36 !NA 36 Not Missing #> 3 12 !NA 12 Not Missing #> 4 18 !NA 18 Not Missing #> 5 NA NA -19.7 Missing #> 6 28 !NA 28 Not Missing #> 7 23 !NA 23 Not Missing #> 8 19 !NA 19 Not Missing #> 9 8 !NA 8 Not Missing #> 10 NA NA -18.5 Missing #> # ... with 143 more rows
airquality %>% cast_shadow_shift_label(Ozone, Solar.R)
#> # A tibble: 153 x 7 #> Ozone Solar.R Ozone_NA Solar.R_NA Ozone_shift Solar.R_shift any_missing #> <int> <int> <fct> <fct> <dbl> <dbl> <chr> #> 1 41 190 !NA !NA 41 190 Not Missing #> 2 36 118 !NA !NA 36 118 Not Missing #> 3 12 149 !NA !NA 12 149 Not Missing #> 4 18 313 !NA !NA 18 313 Not Missing #> 5 NA NA NA NA -19.7 -33.6 Missing #> 6 28 NA !NA NA 28 -33.1 Missing #> 7 23 299 !NA !NA 23 299 Not Missing #> 8 19 99 !NA !NA 19 99 Not Missing #> 9 8 19 !NA !NA 8 19 Not Missing #> 10 NA 194 NA !NA -18.5 194 Missing #> # ... with 143 more rows
# replicate the plot generated by geom_miss_point() library(ggplot2) airquality %>% cast_shadow_shift_label(Ozone,Solar.R) %>% ggplot(aes(x = Ozone_shift, y = Solar.R_shift, colour = any_missing)) + geom_point()