Re: [R] Conditional rows

2008-02-11 Thread Gabor Csardi
:[EMAIL PROTECTED] > Sent: Monday, February 11, 2008 18:27 > To: Ng Stanley > Cc: r-help > Subject: Re: [R] Conditional rows > > which(apply(test<=0.2, 1, all)) > > See ?which, ?all, and in particular ?apply. > > Gabor > > On Mon, Feb 11, 2008 at 06:22:09P

Re: [R] Conditional rows

2008-02-11 Thread Stanley Ng
That works beautfully. Why using test<=0.2 || test >0.3 gives error ? -Original Message- From: Gabor Csardi [mailto:[EMAIL PROTECTED] Sent: Monday, February 11, 2008 18:27 To: Ng Stanley Cc: r-help Subject: Re: [R] Conditional rows which(apply(test<=0.2, 1, all)) See ?wh

Re: [R] Conditional rows

2008-02-11 Thread Dimitris Rizopoulos
o: "r-help" Sent: Monday, February 11, 2008 11:22 AM Subject: [R] Conditional rows > Hi, > > Given a simple example, test <- matrix(c(0.1, 0.2, 0.1, 0.2, 0.1, > 0.1, 0.3, > 0.1, 0.1), 3, 3) > > How to generate row indexes for which their corresponding row values

Re: [R] Conditional rows

2008-02-11 Thread Gabor Csardi
which(apply(test<=0.2, 1, all)) See ?which, ?all, and in particular ?apply. Gabor On Mon, Feb 11, 2008 at 06:22:09PM +0800, Ng Stanley wrote: > Hi, > > Given a simple example, test <- matrix(c(0.1, 0.2, 0.1, 0.2, 0.1, 0.1, 0.3, > 0.1, 0.1), 3, 3) > > How to generate row indexes for which thei

[R] Conditional rows

2008-02-11 Thread Ng Stanley
Hi, Given a simple example, test <- matrix(c(0.1, 0.2, 0.1, 0.2, 0.1, 0.1, 0.3, 0.1, 0.1), 3, 3) How to generate row indexes for which their corresponding row values are less than or equal to 0.2 ? For this example, row 2 and 3 are the correct ones. Thanks [[alternative HTML version de