A helper function that renames columns in a data frame based on a specified mapping.
Used internally in get_var_structure()
, get_data_by_dims()
, and rename_dims()
.
rename_col(df, rename_cols)
A modified data frame with renamed columns.
A data frame containing columns to be renamed.
A named vector where names are existing column names, and values are the corresponding new names.
Pattawee Puangchit
Replaces column names according to the provided rename_cols
mapping.
Ensures no duplicate column names by appending numerical suffixes when necessary.
Helps standardize column names across SL4 and HAR datasets.
get_var_structure
, get_data_by_dims
, rename_dims