Thanks also for your many interesting and useful contributions to my education and that of many others.
Best Wishes, Spencer Graves
Peter Dalgaard BSA wrote:
Spencer Graves <[EMAIL PROTECTED]> writes:
A common, punishing error for me, with DF being a data frame, is the following:
if(DF$a = 1) ...
where I intended to write "if(DF$a == 1)...". This error first replaces column "a" of DF with the trivial vector 1 (of length 1), and then interprets that as a logical, which evaluates as TRUE. Unless the "if" statement otherwise generates an error, I must restore column "a" from somewhere before I can continue.
Eh?
a <- list(x=2) if (a$x = 1) 5
Error: syntax error
I think you're referring to another R-like language....
In addition to specifying function arguments, I also use "=" to specify named components of a list or a vector. That works fine for me. It's only the accidental use of "=" when I mean "==" that creates problems.
(Actually, that's the same thing. list() and c() are function calls like (almost) everything else.)
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
