M = matrix(1:9,3,3)
colnames(M)=c('a','b','c')
Suppose I have a matrix M
, with column names 'a','b','c'. And I want to remove the names, so that M
M [,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
Rather than
a b c
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9
How do I do this?