I know how to use <-
and ->
, and there are several writeups on the difference between equals
assignment & arrow assignment, but I don't know when to prefer ->
over <-
.
It seems the community has coalesced around using <-
for assignment.
Neither the google R style-guide, nor Hadley Wickam's tidyverse R style-guide even mention ->
in the assignment section.
I'm curious about the design considerations that led the S/S-PLUS developers to put in the right arrow assign operator ->
. In what setting(s) would using ->
be considered more readable (or easier to type) versus <-
or =
?
I'm not familiar with any other language that allows the right-assignment semantics. What languages inspired R in this regard?
I'm looking for answers that cite books / early design documents / user manuals / archived mailing lists or other references to establish what the S author/designer's intent was in putting in the forward-arrow assignment operator.
->
and<-
? Except for the perceived difference explained in https://mcmap.net/q/372490/-different-behavior-of-gt-right-arrow-and-lt-left-arrow-on-a-for-loop/7870777 which is not actually a difference but just a difference in perception. – Gullet