Re: [R] Subcripting matrix

2013-09-20 Thread Olivier Crouzet
Hi, it seems the following works as needed... Mat[,colnames(Mat)=="a"] Olivier. On Fri, 20 Sep 2013 16:22:37 +0530 Christofer Bogaso wrote: > Hello again, > > I have one question on subscripting matrix. Let say I have following > matrix: > > > Mat <- matrix(1:9, 3) > > colnames(Mat) <- c("a

Re: [R] Subcripting matrix

2013-09-20 Thread Berend Hasselman
On 20-09-2013, at 12:52, Christofer Bogaso wrote: > Hello again, > > I have one question on subscripting matrix. Let say I have following matrix: > >> Mat <- matrix(1:9, 3) >> colnames(Mat) <- c("a", "b", "a") >> Mat > a b a > [1,] 1 4 7 > [2,] 2 5 8 > [3,] 3 6 9 > > > Now I want to fetc