[R] the less-than-minus gotcha

Mike Miller mbmiller+l at gmail.com
Tue Feb 3 09:40:34 CET 2015


Kevin Thorpe wrote,

"Moral of story, computers do what you tell them, not what you meant."

But hope springs eternal!  Of course this aphorism explains neatly every 
problem I've ever run across while using a computer.  But maybe someday 
they'll make a computer that undertands *me*!

Peter Dalgaard wrote,

"I'd rather say that it is good reason to use spaces around operators. 
Makes the code easier to read too."

I think that's the real lesson.  I try to do that, but I'll be trying even 
harder now.


If they'd thought of it long ago, S and R could have been written so that 
"<-" had to be followed by a space or an error would result.  That might 
have been a good idea, but it's too late now.  So we just have to not make 
mistakes.  I'm working on it.

Mike



More information about the R-help mailing list