Use equal sign for assignmentin R?

Steve Simon

2013-12-09

I learned R back when the only way to assign a value was with the <- operator. For example, if you were computing the hypotenuse of a triangle, you’d use c <- sqrt(a^2+b^2). But the language now allows you to use an equals sign instead, which is the choice in many other programming languages. Should you do this? I say “no” emphatically, but this website makes an interesting counter-argument.

David Smith, Use = or <- for assignment. Revolutions Blog, December 16, 2008. Available in html format.

You can find an earlier version of this page on my blog.