Peter Dalgaard <[EMAIL PROTECTED]> 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]]

______________________________________________
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

Reply via email to