rename field in r code example
Example 1: R rename singl edf column
colnames(trSamp)[2] <- "newname2"
Example 2: r: rename a column
colnames(df)[which(names(df) == "columnName")] <- "newColumnName"
colnames(trSamp)[2] <- "newname2"
colnames(df)[which(names(df) == "columnName")] <- "newColumnName"