Skip to content
Prev 206624 / 398503 Next

advice/opinion on "<-" vs "=" in teaching R

Java, and to use <- otherwise.

Nothing like an option to induce polarisation!

'=' is used in at least two contexts in R, one of which does not imply
formal assignment. 

'<-' (and the left-to-right version '->') only mean formal assignment.

It is nearly always better in teaching programming languages to teach
the unambiguous/'always safe' form first or only. 

Anyone who learns multiple languages should be able to cope with such a
small change in operator, and the rather important difference between
assignment, name/value pairing and logical equals that R makes explicit
is actually a useful indicator that they are genuinely different
things.

Steve Ellison



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}