[R-sig-teaching] The pedagogy of the assignment operator

Gabor Grothendieck ggrothendieck at gmail.com
Wed Oct 27 03:01:15 CEST 2010


On Tue, Oct 26, 2010 at 8:41 PM, Murray Jorgensen <maj at waikato.ac.nz> wrote:
> I can see that I am going to have to set a little context because I wanted
> to anchor the discussion in the teaching of statistics, and not of R as a
> language. I think the issues are different in the two. One big problem in
> the former is that symbols can engender fear in the students.
>
> A few years ago I was taken off the teaching of a large first year business
> statistics course. The clinching incident in this decision mentioned by my
> then chairperson was the use ( in a side-discussion ) of the mathematical
> summation sign ( upper-case Greek sigma ).  I don't think my chairperson was
> wrong. In the context of that course what I should have done was illustrate
> my point with a column of data in an Excel spreadsheet.
>
> If \Sigma upsets business students with its suggestion of abstract
> mathematics, I think many other statistics students find <- somewhat
> suggestive of abstract logic or theoretical computer science, favourite
> subjects of an epsilonic proportion of the large classes I used to teach.
>
> I teach smaller classes now and my students come to me with previous
> exposure to Minitab which uses = for assignment. I use = both to avoid any
> of the symbol-fear that I spoke of, and also because they are used to how
> assignment works in Minitab. (For maybe half of the students, Minitab would
> be the only computer language that they would have met.)
>
> I will come clean and admit that I have another reason for not liking R.
> The symbol <- suggests the right-to-left direction of the assignment
> strongly and appropriately. But I read from left-to-right and I get startled
> by an arrow coming at me from the unseen future and feel a second or two of
> cognitive dissonance.
>
> I actually rather like the right-pointing -> assignment as the directions of
> reading and of computation agree. It would be a bit idiosyncratic to use it
> in code though. I find it useful in interactive R when I have typed and
> evaluated a complex expression and realise that I really should have
> assigned it to something. After the up-arrow key -> lets me do the needed
> assignment on the right of the expression.
>

To me = reminds me of equality and its easily confused with == whereas
 <- unambiguously means assignment.

-> should not be taught. Its too weird and almost never appears in
code out there so its wasting people's time on trivia rather than
focusing them on the essentials.

The fact is that R involves programming and syntax and if they fear
that to the extent that it requires teaching bad practice then it
might be better to forget about R entirely and switch to something
more palatable driven by a GUI.  This might be some other software
entirely or maybe Rcmdr or other GUI front end to R.


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com




More information about the R-sig-teaching mailing list