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