Skip to content
Prev 319 / 885 Next

The pedagogy of the assignment operator

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.

Murray
On 27/10/2010 12:59 p.m., Gabor Grothendieck wrote: