Are `=` and `<-` exactly the same in R?

Possible duplicate:
Assignment operators in R: & lsquo; = & rsquo; and <- & rsquo;

Is this just a style preference?

As far as I can tell, this is the same .

I see that many prefer the “longer” version <-, and I can’t say why (perhaps avoiding confusion =and ==?)

+5
source share
1 answer

No, they are not exactly the same: the operator =cannot be used wherever it <-can.

< - = , . < - , = (, , ) .

. . .

, .


" - R", :

" =, ==, . < - , , - , ( Spector, P. (2009)." R" - 8.7. system.time, = )


, Google R <-:

< -, not =, .

:
x < -5

BAD:
x = 5

+7

All Articles