R rename columns to a sequence 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)