[R] abs(U) > 0 where U is a vector?

Romain Francois rfrancois at mango-solutions.com
Wed Mar 14 11:46:09 CET 2007


Benjamin Dickgiesser wrote:
> Hi,
>
> I am looking for a way to compare if every element of a vector is > 0.
>
> i.e.
> while(abs(U) > 0)
> {
>
> ..
> }
>
> is there a function for this or do I have to write one?
>
> I'd appreciate your help!
>
> Benjamin
>   
Hi,

If I understand you correctly, you are not far, is this what you want :

while(all(abs(U) > 0)){
   ...
}


Cheers,

Romain

-- 
Mango Solutions
data analysis that delivers

Tel:  +44(0) 1249 467 467
Fax:  +44(0) 1249 467 468
Mob:  +44(0) 7813 526 123



More information about the R-help mailing list