This function recodes given values to NA (missing)
in given variables of a data.frame.
Arguments
- df
data.frame
- vars
(character) vector of variable names
- values
(vector) values to replace with
NA
Examples
df <- df |> recode_values_to_NA(vars="x"%p%1:3, values=0)
#> [1] "Replaced these values in variables with NA:"
#> $Variables
#> [1] "x1" "x2" "x3"
#>
#> $Values
#> [1] 0
#>