Closed Robinlovelace closed 5 years ago
If you're at all thinking about submitting to ROpenSci, then you'll have to at some stage switch to <-
anyway. Plus goodpractice::gp()
is just plain out supremely helpful, and you can only minimise output there with <-
.
Sounds good. It also seems there's a pkg for converting all those =
into <-
, from the rOpenSci style guide: https://github.com/r-lib/styler
been using alt+[-] :)
More on this here: https://github.com/csgillespie/efficientR/issues/34
I use =
assignment because it's good for teaching. Yihui Xie also uses it in packages. knitr
, for example, a package that is central to R's ability to create documents, is written with =
assignment. So it's really a matter of preference. Interested to hear your views. We discussed it at length for the geocompr book and have decided to go with =
. Arguments go both ways. Origin of <-
seems to be that there was a special key for it and =
didn't work with Splus so it's there for historical reasons and backwards compatibility. It's ability to 'clearly show when an object has been assigned' is the strongest up-to-date reason I've heard, other than conforming to previous convention.
<-
,=
,assign()
what's it to be? At the minute we have a mixture.