rename colomn 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 a column
colnames(df)[which(names(df) == "columnName")] <- "newColumnName"