RE: [R] count element in column

From: Andy Bunn <abunn_at_whrc.org>
Date: Thu 06 Jan 2005 - 04:18:50 EST


How about this?
length(res[res < 0, 1])
HTH, Andy

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch]On 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 (thus a column) and I would like to
> count the number of negative element inside.
> Can you help me?
> Thanks!
>
> eg:
> res[,1]= 1
> -3
> -1
>
> How obtain the number 2 (number of negative-element)?
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Thu Jan 06 04:11:59 2005

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 01:24:22 EST