Pass a variable to dplyr "rename" to change columnname code example
Example: Pass a variable to dplyr "rename" to change columnname
df %>% rename(!!variable := name_of_col_from_df)
df %>% rename(!!variable := name_of_col_from_df)