[R] help on error message!!!

Bernardo Rangel Tura tura at centroin.com.br
Sun Nov 4 15:27:05 CET 2007


On Sun, 2007-11-04 at 15:06 +0100, david csongor wrote:
> Could anyone please  help me with this one!!!
> I am looping some simple stuff but when I enter an if - function I get this
> error message:
> 
> >>>>
> Error in if (y < (2/(1 * pi) * sqrt(1 - ((x - 2)/1)^2))) c[i] = x else c[i]
> = 0 :
>         missing value where TRUE/FALSE needed
> >>>>
> 
> WHAT does it mean, what should I do????

Try ifelse:

c<-ifelse(y < (2/(1 * pi)*sqrt(1 -(x - 2)^2)),x,c[i])
-- 
Bernardo Rangel Tura, M.D,Ph.D
National Institute of Cardiology
Brazil



More information about the R-help mailing list