[R] the less-than-minus gotcha

Ben Bolker bbolker at gmail.com
Mon Feb 2 02:07:23 CET 2015


Mike Miller <mbmiller+l <at> gmail.com> writes:

> 
> I've got to remember to use more spaces.  Here's the basic problem:
> 
> These are the same:
> 
> v< 1
> v<1
> 
> But these are extremely different:
> 
> v< -1
> v<-1
> 

This is indeed documented, in passing, in one of the pages you listed:

http://tim-smith.us/arrgh/syntax.html

Whitespace is meaningless, unless it isn't. Some parsing ambiguities 
are resolved by considering whitespace around operators. See and
despair: x<-y (assignment) is parsed differently than x < -y (comparison)!



More information about the R-help mailing list