powered by
This provides a convenient way to convert a number/value to another value.
recode_as_value( df, value = NULL, replacement_value = NULL, subset_cols = NULL, pattern_type = NULL, pattern = NULL, case_sensitive = FALSE, ... )
A data.frame object for which recoding is to be done.
The value/vector of values to convert.
New value.
An optional character vector to define columns for which changes are required.
One of contains', 'starts_with' or 'ends_with'.
A character pattern to match
Defaults to FALSE. Patterns are case insensitive if TRUE
Other arguments to other functions
An object of the same class as x with values changed to `NA`.
# NOT RUN { head(recode_as_value(airquality, value=c(67,118),replacement=NA, pattern_type="starts_with",pattern="S|O")) # }
Run the code above in your browser using DataLab