change col name in r code example Example: r - change column name colnames(df)[colnames(df) == "name"] <- "new_name"