RE: [R] count element in column

2005-01-05 Thread Andy Bunn
How about this? length(res[res 0, 1]) HTH, Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Frederic renaud Sent: Wednesday, January 05, 2005 11:08 AM To: r-help@stat.math.ethz.ch Subject: [R] count element in column Hi, I 've a matrix n*1

Re: [R] count element in column

2005-01-05 Thread Robert Kruus
How about sum(res0)? -- [EMAIL PROTECTED] The computer should be doing the hard work. That's what it's paid to do, after all. -- Larry Wall in [EMAIL PROTECTED] It is rumored that on Wed, 5 Jan 2005 08:07:34 -0800 (PST) Frederic renaud [EMAIL PROTECTED] wrote: Hi, I

Re: [R] count element in column

2005-01-05 Thread Robert Kruus
How about sum(res0)? -- [EMAIL PROTECTED] The computer should be doing the hard work. That's what it's paid to do, after all. -- Larry Wall in [EMAIL PROTECTED] It is rumored that on Wed, 5 Jan 2005 08:07:34 -0800 (PST) Frederic renaud [EMAIL PROTECTED] wrote: Hi, I

RE: [R] count element in column

2005-01-05 Thread Berton Gunter
How about this? length(res[res 0, 1]) HTH, Andy or simply sum(res0) . For R beginners: This works because the logical res0 vector is automatically coerced to a numeric vector of 0's and 1's by sum(). -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA

Re: [R] count element in column

2005-01-05 Thread Anne
x-c(-3. -4.7, -.005, 1, 9) length(x[x0]) [1] 3 Anne - Original Message - From: Frederic renaud [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Wednesday, January 05, 2005 5:07 PM Subject: [R] count element in column Hi, I 've a matrix n*1 (thus a column) and I would like to