Re: [R] remove elements from matrix

2011-09-30 Thread Ulrich Staudinger
Am 30.09.2011 11:30, schrieb Alaios: Dear all, I have a numeric vector that contains indices. I also have two matrices of [1,m] dimension and of [m,n] dimension. I want for every indexto remove the current element from the [1,m] vector an the row from the [m,n] matrix. How I can do that efficie

Re: [R] remove elements from matrix

2011-09-30 Thread Jannis
Try this. As you did not supply a reproducible example my code is untested: 1.m.vector[index.vector] <- NULL or new.1.m.vector <- 1.m.vector[- index.vector] Someting equivalent is possible for the matrix. HTH Jannis On 09/30/2011 11:30 AM, Alaios wrote: Dear all, I have a numeric vector th

[R] remove elements from matrix

2011-09-30 Thread Alaios
Dear all, I have a numeric vector that contains indices. I also have two matrices of [1,m] dimension and of [m,n] dimension. I want for every indexto remove the current element from the [1,m] vector an the row from the [m,n] matrix. How I can do that efficiently in R? So to say not have a for loo