Re: [R] result NA , but expected True or False

2015-08-10 Thread William Dunlap
The || operator will always return a result of type 'logical' and length 1. You gave it two operands of length 0, so it returned the logical value NA, meaning it had no idea what the result should be. If you give it operands of length 1, it will use the only the first elements of them. (S and

Re: [R] result NA , but expected True or False

2015-08-10 Thread David Winsemius
On Aug 9, 2015, at 8:45 PM, Ragia Ibrahim wrote: 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)

[R] result NA , but expected True or False

2015-08-09 Thread Ragia Ibrahim
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) ||