how to rename of a colum as per next column in R code example
Example 1: r rename column based on variable
rename(df, !!metric:=value)
Example 2: r rename column based on variable
df %>% rename(!!variable := name_of_col_from_df)
rename(df, !!metric:=value)
df %>% rename(!!variable := name_of_col_from_df)