Skip to contents

As an alternative to bind_shadow(), you can add specific individual shadow columns to a dataset. These also respect the dplyr verbs starts_with, contains, ends_with, etc.

Usage

add_shadow(data, ...)

Arguments

data

data.frame

...

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

Value

data.frame

Examples


airquality %>% add_shadow(Ozone)
#> # A tibble: 153 × 7
#>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA
#>    <int>   <int> <dbl> <int> <int> <int> <fct>   
#>  1    41     190   7.4    67     5     1 !NA     
#>  2    36     118   8      72     5     2 !NA     
#>  3    12     149  12.6    74     5     3 !NA     
#>  4    18     313  11.5    62     5     4 !NA     
#>  5    NA      NA  14.3    56     5     5 NA      
#>  6    28      NA  14.9    66     5     6 !NA     
#>  7    23     299   8.6    65     5     7 !NA     
#>  8    19      99  13.8    59     5     8 !NA     
#>  9     8      19  20.1    61     5     9 !NA     
#> 10    NA     194   8.6    69     5    10 NA      
#> # ℹ 143 more rows
airquality %>% add_shadow(Ozone, Solar.R)
#> # A tibble: 153 × 8
#>    Ozone Solar.R  Wind  Temp Month   Day Ozone_NA Solar.R_NA
#>    <int>   <int> <dbl> <int> <int> <int> <fct>    <fct>     
#>  1    41     190   7.4    67     5     1 !NA      !NA       
#>  2    36     118   8      72     5     2 !NA      !NA       
#>  3    12     149  12.6    74     5     3 !NA      !NA       
#>  4    18     313  11.5    62     5     4 !NA      !NA       
#>  5    NA      NA  14.3    56     5     5 NA       NA        
#>  6    28      NA  14.9    66     5     6 !NA      NA        
#>  7    23     299   8.6    65     5     7 !NA      !NA       
#>  8    19      99  13.8    59     5     8 !NA      !NA       
#>  9     8      19  20.1    61     5     9 !NA      !NA       
#> 10    NA     194   8.6    69     5    10 NA       !NA       
#> # ℹ 143 more rows