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:
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
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
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.
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!
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
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
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
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
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
10 matches
Mail list logo