

Peter Dalgaard <p.dalgaard@biostat.ku.dk> wrote:
Robert writes:

> Professor,
> What does if ((x=2)) 2 mean?
> Thanks,
> Robert

it assigns 2 to x, then uses the result (i.e. whether it is non-zero)
as the condition for the if() construct. So in this case, the
condition is always TRUE and the result is always 2.

I see. 

> if ((x=2)) 2
[1] 2
> if ((x=0)) 2
> 


		
---------------------------------

	[[alternative HTML version deleted]]


