[R] advice/opinion on " < -" vs " =" in teaching R
Ben Bolker
bolker at ufl.edu
Fri Jan 15 17:00:23 CET 2010
John Kane <jrkrideau <at> yahoo.ca> writes:
>
> I've only been using R for about 2.5 years but and I'm not all that good but
I vote for <- .
>
> I think the deciding factor is in RSiteSearch() and the various manuals.
>
> Almost everything I see uses <- . Why introduce = when it is not used
normally? It will just confuse the
> students who are trying to use any of the documentation.
>
> Not to mention they might slammed for bad syntax
> on the R-help mailing list. :)
>
Those are all good reasons.
I have said something similar before
(see <http://www.mail-archive.com/r-help@r-project.org/msg16904.html>),
but I tend to use = because it seems to be more intuitive for
students, despite being logically confused at a deeper level,
and I want to spare them any additional cognitive load when they
are first getting introduced to R.
I'm not particularly convinced by the "<- is more general
and there are some contexts where = doesn't work", because I'm
not trying to be absolutely rigorous, nor teach all the possible
ins and outs of R syntax. I would be very surprised if any of
the examples given actually came up in the course of a first-semester
statistics/modeling R course. I just want to do what works best for
the students -- the problem is deciding on the balance between
short term benefit (<- is one more odd thing to get used to)
and long term benefit (they will see <- in other contexts, so
they might as well get used to it eventually).
Ben Bolker
More information about the R-help
mailing list