View source: R/convert_column_names.R
convert_column_names | R Documentation |
Convert values in a vector to their cooresponding values according to a data frame
convert_column_names(names_vector, names_map)
names_vector |
The column names of a data frame. i.e. the character vector returned from calling 'names()' on a data frame. |
names_map |
A data frame with 2 columns:
|
The names where every old name in names is replaced with its cooresponding display name
names_vector <- c("lot_location_code", "location_name", "actions") names_map <- data.frame( names = c("location_name", "lot_location_code"), display_names = c("Location Name", "Lot Location Code"), stringsAsFactors = FALSE ) convert_column_names(names_vector, names_map)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.