[R] "is" and the story of a typo
Jim Lemon
jim at bitwrit.com.au
Wed Mar 31 01:23:09 CEST 2010
Hi all,
The gurus may pour scorn on me for not knowing this, but I happened to
mistype "if" as "is" in the heat of debugging a function. As I scanned
the debugged function with some satisfaction, I noticed the error. How
could this have worked? I assume that "is" is a generic function that
calls one of the is.* functions to evaluate whatever is passed. It
appears that this particular typo causes "is" to work out and report the
contents of its argument. Ho hum. As I did not test the FALSE result, I
never would have noticed that it was not the conditional statement I
expected until it evaluated something that should have been FALSE.
Jim
More information about the R-help
mailing list