Re: [R] questions on some operators in R

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Fri, 18 Jun 2010 17:57:05 -0400

On Jun 18, 2010, at 5:15 PM, Horace Tso wrote:

> You still couldn't sway me into the <- camp. '=' is better for yet
> two more reasons,
>
> 1. it requires one keystroke, rather than two,
>
> 2. to type '<', one has to hold Shift then the ',' key, so it's a
> total of three strokes all together.
>
> In a typical script, you have hundreds of assignment statements.
> Those extra keystroke translate into quite a bit more wear on your
> fingers.

If you are so productive that the rate-limiting step in your statistical programming is the number of times you need to type "<-", then your sample(c("MacArthur Award", "Nobel Prize", "Chambers Award"), 1, prob=c(0.1,0.1, 0.8) ) , will surely be granted in rnorm(1, 8) years.

-- 
David.

>
> H
>
> -----Original Message-----
> From: Erik Iverson [mailto:eriki_at_ccbr.umn.edu]
> Sent: Friday, June 18, 2010 1:23 PM
> To: Greg Snow
> Cc: Horace Tso; li li; r-help
> Subject: Re: [R] questions on some operators in R
>
>
>
> 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. :)
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
David Winsemius, MD West Hartford, CT ______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Fri 18 Jun 2010 - 21:59:47 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 - 22:20:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive