replace column names in r code example
Example 1: rename column in r
my_data %>%
rename(
sepal_length = Sepal.Length,
sepal_width = Sepal.Width
)
Example 2: r set dataframe column names
R> colnames(X)[2] <- "superduper"
my_data %>%
rename(
sepal_length = Sepal.Length,
sepal_width = Sepal.Width
)
R> colnames(X)[2] <- "superduper"