View source: R/translate_value.R
translate_value | R Documentation |
Convert a value from something old to something new (using gsub)
translate_value(x, old, new, ...)
## S3 method for class 'data.frame'
translate_value(x, old, new, ..., exclude_col = NULL)
## S3 method for class 'factor'
translate_value(x, old, new, ...)
## S3 method for class 'character'
translate_value(x, old, new, ..., fixed = TRUE)
## Default S3 method:
translate_value(x, old, new, ...)
x |
The object to translate |
old, new |
The old and new character strings |
... |
Passed to gsub |
exclude_col |
A vector of columns to exclude from data.frame translation |
fixed |
Passed to gsub |
The object with old converted to new
translate_value(data.frame)
: Convert all columns (unless excluded)
translate_value(factor)
: Convert the levels
translate_value(character)
: Use gsub.
translate_value(default)
: No translation done.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.