[R] Matrix Dimnames

2010-08-17 Thread Rookie
Is there a way that I can specify the column names in the matrix function? Currently, below is the way I am doing it. x - matrix(c(15, 7, 20, 12, 25, 14, 30, 19, 35, 7, 15, 7, 20, 17, 25, 19, 30, 25, 35, 10, 15, 15, 20, 12, 25, 19, 30, 22, 35, 11, 15, 11, 20, 18, 25, 18, 30, 19, 35, 15, 15, 9,

Re: [R] Matrix Dimnames

2010-08-17 Thread Joshua Wiley
Hi Rookie, Sure, just use the dimnames argument. You pass it a list where the first element contains the row names and the second element contains the column names. Supposing you only want to name one dimension, just use NULL for the other (see ?matrix for full details). Using your data: x -