[R] Problem whit a piece of program

From: Arturo Coral Alamo <arturo.coral_at_gmail.com>
Date: Fri 14 Oct 2005 - 00:31:05 EST


Hi friends, I'm beginning in R and I have simple question.

I have this piece of my program and how you see, that's ok (whit > num<- 0.002)

num<-0.002 # ok, but not when I change whit num<-0... ? factor1<-1;
while(1)
{

if (num*factor1<1)
factor1<-factor1*10
else
{

print("out ok!!");
break;
}
}

[1] "out ok!!"

but when I change (whit > num<-0) R show this:

Error in if (num * factor1 < 1) factor1 <- factor1 * 10 else { : missing value where TRUE/FALSE needed

I can't understand that error, can somebody help me, please thanks in advance
 Jac

        [[alternative HTML version deleted]]



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 Fri Oct 14 00:34:46 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:44 EST