Re: [R] questions on some operators in R

From: Erik Iverson <>
Date: Fri, 18 Jun 2010 15:22:30 -0500

Greg Snow wrote:
> Your example could also be used as an argument against allowing '=' as a shortcut for <- after all if you are used to using <- (rather than =) then you will see the problem with x<-2 right off. But if we eliminate <- and only use =, then how do you do:

>> mean( x <- rnorm(100) )

> Or
>> system.time( output <- longrunningfunction(args) )

> Is
>> mean( { x=rnorm(100) } )

> Really and improvement?

Certainly not in my mind!

For me, here is certainly an undefinable aesthetic appeal to the '<-' assignment operator. The visual requirement of seeing '<-' for me is so strong, that even when running example code from this list, I must replace all assignments done with '=' to '<-' before submitting them to R! I've also noticed that there seems to be an association between using '=' for assignments and writing code with 0 spaces per line in it. Of course, I insist on fixing that before running the code, too. :) mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 18 Jun 2010 - 20:25:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Jun 2010 - 21:20:41 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive