[R] result NA , but expected True or False

Ragia Ibrahim ragia11 at hotmail.com
Mon Aug 10 05:45:59 CEST 2015


Dear Group,
Kindly,

I have those two lines
if(  (z_nebla==0) ||  (z_nebla_dash==0) )
           CM <- 0         else             
            
               CM <-  0.5 *(1/a)  +   0.5*(1/b)  

when running it

I got this

z_nebla==0)
logical(0)
> (z_nebla_dash==0)
logical(0)
> (z_nebla==0) ||  (z_nebla_dash==0)
[1] NA


why  (z_nebla==0) ||  (z_nebla_dash==0)
gives me NA ?

thanks in advance
Ragia

 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list