Description Usage Arguments Value Examples
View source: R/recode_as_value.R
This provides a convenient way to convert a number/value to another value.
1 2 3 4 5 6 7 8 9 10 |
df |
A data.frame object for which recoding is to be done. |
value |
The value/vector of values to convert. |
replacement_value |
New value. |
subset_cols |
An optional character vector to define columns for which changes are required. |
pattern_type |
One of contains', 'starts_with' or 'ends_with'. |
pattern |
A character pattern to match |
case_sensitive |
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'.
1 2 | head(recode_as_value(airquality,
value=c(67,118),replacement=NA, pattern_type="starts_with",pattern="S|O"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.