[R] increase or decrease variable by 1

Ivan Calandra ivan.calandra at uni-hamburg.de
Tue Dec 7 17:23:17 CET 2010


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<madrazel at interia.pl>  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
>
>
>

-- 
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
ivan.calandra at uni-hamburg.de

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/1525_8_1.php



More information about the R-help mailing list