Re: [R] questions on some operators in R

2010-06-19 Thread Jim Lemon
On 06/19/2010 09:14 PM, Patrick Burns wrote: On 19/06/2010 12:00, Jim Lemon wrote: Greg Snow wrote: ... If you really care more about saving characters or key strokes over clarity of expression then you should really be using APL... I think maybe it is K rather than APL. No, APL. I still hav

Re: [R] questions on some operators in R

2010-06-19 Thread Patrick Burns
On 19/06/2010 12:00, Jim Lemon wrote: Greg Snow wrote: ... If you really care more about saving characters or key strokes over clarity of expression then you should really be using APL... I think maybe it is K rather than APL. Pat I would agree with that. When I had to learn APL at univers

Re: [R] questions on some operators in R

2010-06-19 Thread Jim Lemon
Greg Snow wrote: ... If you really care more about saving characters or key strokes over clarity of expression then you should really be using APL... I would agree with that. When I had to learn APL at university, I hated it because it was like typing hieroglyphics. Finally I bought the manua

Re: [R] questions on some operators in R

2010-06-19 Thread Ivan Calandra
Dear users, Regarding the number of keystrokes, you guys should not forget that not everybody has a QWERTY keyboard, and therefore the number of strokes isn't the same for everybody. On an AZERTY keyboard (French), "<" is written without pressing SHIFT, as is "=". On a QWERTZ (German) "=" req

Re: [R] questions on some operators in R

2010-06-18 Thread Greg Snow
. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: Horace Tso [mailto:horace@pgn.com] > Sent: Friday, June 18, 2010 3:15 PM > To: Erik Iverson; Greg Snow > Cc: r-help > Subject: RE:

Re: [R] questions on some operators in R

2010-06-18 Thread Joris Meys
On Fri, Jun 18, 2010 at 8:15 PM, Horace Tso wrote: ... >> which(x<-2) > Error in which(x <- 2) : argument to 'which' is not logical > > Oops, what happened? If you look up help pages for 'which', you'd find no > clue. You just have to look at the error message. R adds the spaces and you see immed

Re: [R] questions on some operators in R

2010-06-18 Thread Joshua Wiley
t plus the space before and after it, which I would add for readability anyways (although I suppose liking spaces in code may just be personal taste). > > H > > -Original Message- > From: Erik Iverson [mailto:er...@ccbr.umn.edu] > Sent: Friday, June 18, 2010 1:23 PM > T

Re: [R] questions on some operators in R

2010-06-18 Thread david.jessop
h +44 20 7567 9882 - Original Message - From: r-help-boun...@r-project.org To: Horace Tso Cc: r-help Sent: Fri Jun 18 23:26:23 2010 Subject: Re: [R] questions on some operators in R On Fri, Jun 18, 2010 at 2:15 PM, Horace Tso wrote: > Li li, > > I know many S-language old time

Re: [R] questions on some operators in R

2010-06-18 Thread Horace Tso
3 PM To: Horace Tso Subject: RE: [R] questions on some operators in R And the 2nd example? -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: Horace Tso [mailto:horace@pgn.com] > Sent:

Re: [R] questions on some operators in R

2010-06-18 Thread Gabor Grothendieck
On Fri, Jun 18, 2010 at 2:15 PM, Horace Tso wrote: > Li li, > > I know many S-language old timers would tell you to use <- over = for > assignment. Speaking from my own painful experience of debugging S/R codes, I > much much much prefer '='. In fact, I'd like to see the R language get ride > o

Re: [R] questions on some operators in R

2010-06-18 Thread Horace Tso
Certainly not. I'm just too lazy. -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: Friday, June 18, 2010 2:57 PM To: Horace Tso Cc: Erik Iverson; Greg Snow; r-help Subject: Re: [R] questions on some operators in R On Jun 18, 2010, at 5:15 PM, Horac

Re: [R] questions on some operators in R

2010-06-18 Thread David Winsemius
.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

Re: [R] questions on some operators in R

2010-06-18 Thread Erik Iverson
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. This is a valid point. You can, howeve

Re: [R] questions on some operators in R

2010-06-18 Thread Horace Tso
ypical script, you have hundreds of assignment statements. Those extra keystroke translate into quite a bit more wear on your fingers. H -Original Message- From: Erik Iverson [mailto:er...@ccbr.umn.edu] Sent: Friday, June 18, 2010 1:23 PM To: Greg Snow Cc: Horace Tso; li li; r-help Sub

Re: [R] questions on some operators in R

2010-06-18 Thread Erik Iverson
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

Re: [R] questions on some operators in R

2010-06-18 Thread Greg Snow
From: Horace Tso [mailto:horace@pgn.com] > Sent: Friday, June 18, 2010 12:16 PM > To: li li; Greg Snow > Cc: r-help > Subject: RE: [R] questions on some operators in R > > Li li, > > I know many S-language old timers would tell you to use <- over = for > assignment.

Re: [R] questions on some operators in R

2010-06-18 Thread Joshua Wiley
nding hours finding > out what's wrong with such innocent expression. The worst part is, you'd have > lost your vector x forever. Just image if x is 1200 by 1200 matrix. > > HTH. > > H > > > > > > -Original Message- > From: r-help-boun...@r-project.org [mailto:

Re: [R] questions on some operators in R

2010-06-18 Thread Horace Tso
roject.org] On Behalf Of li li Sent: Friday, June 18, 2010 10:01 AM To: Greg Snow Cc: r-help Subject: Re: [R] questions on some operators in R Thank you all for your kind reply! Hannah 2010/6/18 Greg Snow > Just to expand a little on David's reply. > > The & vs. &am

Re: [R] questions on some operators in R

2010-06-18 Thread li li
Thank you all for your kind reply! Hannah 2010/6/18 Greg Snow > Just to expand a little on David's reply. > > The & vs. && and | vs. || issue is really about where and how you plan to > use things. & and | work on vectors and are intended to be used to combine > logical vectors

Re: [R] questions on some operators in R

2010-06-18 Thread Greg Snow
Just to expand a little on David's reply. The & vs. && and | vs. || issue is really about where and how you plan to use things. & and | work on vectors and are intended to be used to combine logical vectors into a new logical vector (that can be used for various things). && and || are used fo

Re: [R] questions on some operators in R

2010-06-16 Thread David Winsemius
On Jun 16, 2010, at 6:33 PM, li li wrote: Hi all, I have two questions. Can some one give some help? The first question is regarding the pair of operators "&" and "&&". What is the difference between the two? & operates on vectors, returns a vector && operates on the first item in ea