replace column name in r code example
Example 1: rename column in r
my_data %>%
rename(
sepal_length = Sepal.Length,
sepal_width = Sepal.Width
)
Example 2: r rename column based on variable
rename(df, !!metric:=value)
my_data %>%
rename(
sepal_length = Sepal.Length,
sepal_width = Sepal.Width
)
rename(df, !!metric:=value)