Re: [R] Indexing matrix

2009-06-30 Thread Rainer M Krug
On Tue, Jun 30, 2009 at 3:26 PM, Gabor Grothendieck wrote: > On Tue, Jun 30, 2009 at 9:19 AM, Rainer M Krug wrote: > > Hi > > > > imagine the following situation: > > > > a <- runif(100) > > plot(a[a>0.5]) > > > > plots only the elements in the vector which are larger then 0.5 > > > > Now imagine

Re: [R] Indexing matrix

2009-06-30 Thread Gabor Grothendieck
On Tue, Jun 30, 2009 at 9:19 AM, Rainer M Krug wrote: > Hi > > imagine the following situation: > > a <- runif(100) > plot(a[a>0.5]) > > plots only the elements in the vector which are larger then 0.5 > > Now imagine a matrix: > > b <- matrix(runif(2), ncol=40, nrow=50) > image(b[b>0.5]) > Erro

[R] Indexing matrix

2009-06-30 Thread Rainer M Krug
Hi imagine the following situation: a <- runif(100) plot(a[a>0.5]) plots only the elements in the vector which are larger then 0.5 Now imagine a matrix: b <- matrix(runif(2), ncol=40, nrow=50) image(b[b>0.5]) Error in image.default(b[b > 0.5]) : argument must be matrix-like Is there a sim