give names to columns in r code example
Example 1: r set dataframe column names
R> colnames(X)[2] <- "superduper"
Example 2: get matrix row name r
> grades_matrix
Math Science Art
Student_1 90 88 75
Student_2 78 81 95
Student_3 84 85 83
> rownames(grade_matrix)[2]
[1] "Student_2"
> colnames(grade_matrix)[3]
[1] "Art"