How about
sum(res<0)?

-- 
[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 '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)?
> 
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
> 


--------

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to