Re: [R] matrix subsetting assignment with logical mask

2009-07-16 Thread David Winsemius
On Jul 16, 2009, at 6:41 PM, Ross Boylan wrote: If m is a matrix and s is a logical matrix of the same dimensions, I'd like to be able to update m with m[s] <- 0 If m2 is another matrix, I'd also like to be able to do m[s] <- m2 where elements of m for which s is TRUE get the corresponding el

[R] matrix subsetting assignment with logical mask

2009-07-16 Thread Ross Boylan
If m is a matrix and s is a logical matrix of the same dimensions, I'd like to be able to update m with m[s] <- 0 If m2 is another matrix, I'd also like to be able to do m[s] <- m2 where elements of m for which s is TRUE get the corresponding element of m2. However, this doesn't work in R 2.7.1.