replace column names with vector 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"
Example 3: r set dataframe column names
R> colnames(X)[2] <- "superduper"