Skip to contents

This function takes a data frame and a character vector of restrictions. It renames any columns in the data frame matching the restrictions using the simplified names produced by rename_model_code.

Usage

rename_model_columns(df, models)

Arguments

df

A data frame containing columns to rename.

models

Character vector of restrictions (model codes corresponding to column names in df.

Value

The data frame with renamed columns where applicable.

Examples

df <- data.frame(GRGL = 1:3, GRFRPR = 4:6)
rename_model_columns(df, c("GRGL", "GRFRPR"))
#>   GRL EER
#> 1   1   4
#> 2   2   5
#> 3   3   6