how to rename column names in r data frame code example
Example 1: r change column name in dataframe
df <- df %>%
rename(newName1 = oldName1 ,
newName2 = oldName2)
Example 2: rename column in r
my_data %>%
rename(
sepal_length = Sepal.Length,
sepal_width = Sepal.Width
)