dataframe change names in R code example
Example 1: how to change column names in r
colnames(dataset) <- c('name1','name2',..)
Example 2: r - change column name
colnames(df)[colnames(df) == "name"] <- "new_name"
colnames(dataset) <- c('name1','name2',..)
colnames(df)[colnames(df) == "name"] <- "new_name"