![](../logo.png)
Map Columns in a Dataframe Based on a Mapping Table
Source:R/map_column_names.R
map_column_names.Rd
This function renames columns in a given dataframe based on a mapping table. The mapping table should contain the old column names and the new column names that they should be mapped to.
Examples
if (FALSE) { # \dontrun{
mapping <- data.frame(embrace_i_column = c('col1', 'col2'),
embrace_ii_column = c('column1', 'column2'),
new_combined_name = c('new_col1', 'new_col2'))
data <- data.frame(col1 = 1:5, col2 = 6:10)
new_data <- map_columns_based_on_mapping(data, mapping)
} # }