View source: R/make_alphanumeric_conversion.R
| make_alphanumeric_conversion | R Documentation |
Converts specified columns between alphabetical (text) and numeric values. Can either overwrite existing columns or create new ones.
make_alphanumeric_conversion(
data,
column_vars,
from_values,
to_values,
new_names = NULL,
case_sensitive = FALSE
)
data |
A data frame. |
column_vars |
Character vector of column names to convert. |
from_values |
Vector of values to replace (character or numeric). |
to_values |
Vector of replacement values (must be same length as from_values). |
new_names |
Optional character vector of new column names. If NULL (default), original columns are overwritten. |
case_sensitive |
Logical. Only relevant when converting character values. Default is FALSE. |
Factors are automatically converted to character before matching. Unmatched values become NA with a warning.
A data frame with converted values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.