Skip to content
Prev 171369 / 398503 Next

difference between assignment syntax <- vs =

On Mon, 23 Feb 2009, Patrick Burns wrote:

            
Although it's probably true that most long-time R users use <-, this is at least in part because a long-time R user would initially have had to use <-, since = wasn't available in the distant past.

I would say that it's entirely a matter of taste -- the things that otherwise could have been traps are mostly syntax errors.  The only proviso is that if you post code using = it is (even more) important to leave spaces around the = than it would be for <-.

      -thomas
Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle