Re: [R] increase or decrease variable by 1

2010-12-07 Thread Ivan Calandra
x+1 is not that complicated... Am I missing something here? Le 12/7/2010 16:55, Gabor Grothendieck a écrit : On Tue, Dec 7, 2010 at 8:43 AM, madr wrote: many languages have shorthands for that operation like: variable += 1 or ++variable is there something like that in R ? You can do this:

Re: [R] increase or decrease variable by 1

2010-12-07 Thread Duncan Murdoch
On 07/12/2010 12:42 PM, Gabor Grothendieck wrote: On Tue, Dec 7, 2010 at 12:25 PM, Bert Gunter wrote: Ted: Inline below... On Tue, Dec 7, 2010 at 8:42 AM, Ted Harding wrote: Indeed! x<- x + 1 (and being generous with unnecessary spaces) uses 10 characters. `+`(x)<-1 (being mean with

Re: [R] increase or decrease variable by 1

2010-12-07 Thread Bert Gunter
Ted: Inline below... On Tue, Dec 7, 2010 at 8:42 AM, Ted Harding wrote: > Indeed! > >  x <- x + 1 > > (and being generous with unnecessary spaces) uses 10 characters. > >  `+`(x)<-1 > > (being mean with them) uses 9. The "mean" version of the first > uses only 6: x<-x+1 > > However, I suppose th

Re: [R] increase or decrease variable by 1

2010-12-07 Thread Ted Harding
Indeed! x <- x + 1 (and being generous with unnecessary spaces) uses 10 characters. `+`(x)<-1 (being mean with them) uses 9. The "mean" version of the first uses only 6: x<-x+1 However, I suppose there is merit in the spiritual exercise of contemplating how `+`(x)<-1 gets worked out! Ted.

Re: [R] increase or decrease variable by 1

2010-12-07 Thread Gabor Grothendieck
On Tue, Dec 7, 2010 at 1:12 PM, David Winsemius wrote: > > On Dec 7, 2010, at 12:42 PM, Gabor Grothendieck wrote: > >> On Tue, Dec 7, 2010 at 12:25 PM, Bert Gunter >> wrote: >>> >>> Ted: >>> >>> Inline below... >>> >>> On Tue, Dec 7, 2010 at 8:42 AM, Ted Harding >>> wrote: Indeed!

Re: [R] increase or decrease variable by 1

2010-12-07 Thread David Winsemius
On Dec 7, 2010, at 12:42 PM, Gabor Grothendieck wrote: On Tue, Dec 7, 2010 at 12:25 PM, Bert Gunter wrote: Ted: Inline below... On Tue, Dec 7, 2010 at 8:42 AM, Ted Harding wrote: Indeed! x <- x + 1 (and being generous with unnecessary spaces) uses 10 characters. `+`(x)<-1 (being

Re: [R] increase or decrease variable by 1

2010-12-07 Thread Gabor Grothendieck
On Tue, Dec 7, 2010 at 12:25 PM, Bert Gunter wrote: > Ted: > > Inline below... > > On Tue, Dec 7, 2010 at 8:42 AM, Ted Harding wrote: >> Indeed! >> >>  x <- x + 1 >> >> (and being generous with unnecessary spaces) uses 10 characters. >> >>  `+`(x)<-1 >> >> (being mean with them) uses 9. The "mean

Re: [R] increase or decrease variable by 1

2010-12-07 Thread Gabor Grothendieck
On Tue, Dec 7, 2010 at 8:43 AM, madr wrote: > > many languages have shorthands for that operation like: > > variable += 1 > or > ++variable > > is there something like that in R ? You can do this: > x <- 3 > `+`(x) <- 1 > x [1] 4 -- Statistics & Software Consulting GKX Group, GKX Associates

Re: [R] increase or decrease variable by 1

2010-12-07 Thread Uwe Ligges
On 07.12.2010 14:43, madr wrote: many languages have shorthands for that operation like: variable += 1 or ++variable is there something like that in R ? No. Uwe Ligges __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] increase or decrease variable by 1

2010-12-07 Thread madr
many languages have shorthands for that operation like: variable += 1 or ++variable is there something like that in R ? -- View this message in context: http://r.789695.n4.nabble.com/increase-or-decrease-variable-by-1-tp3076390p3076390.html Sent from the R help mailing list archive at Nabble.c