On Wed, 27 Oct 2010 08:10:41 +1300, Murray Jorgensen <[email protected]> wrote:
> Greetings all, in my own R code I have used various forms of the R > assignment operator at different times in my life. There are arguments > for and against each choice. > A question I would like this sig is whether there are any specifically > teaching reasons for preferring one form over another? > A second question, mainly to clarify the first, is whether different > forms might be preferred for different types of student? > Awaiting responses with interest Personally I find the most compelling reason to get into the habit of using "<-" for assignments as early as possible is that it has a single meaning, whereas "=" has two different meanings as others have pointed out. It makes code a lot cleaner and easier to read because assignments readily stand-out from parts where a value is being given to an argument. Although it might be easier for some new users to read and type "=" for assignments, it blurs the distinction between the two different meanings for "=". Because these different meanings depend on the context, that's one more thing for a user to keep in mind. -- Seb _______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-teaching
