by jebus989 · 12y ago · 0 comments
1) Google says so: http://google-styleguide.googlecode.com/svn/trunk/Rguide.xml
2) It's the accepted convention of the language. When she looks things up of SO, they'll use it; if she looks at a package's source, they'll use it.
3) In RStudio it's "option+hypen" (Mac) to type the four-character " <- ", so no extra typing required.
4) Statistically-speaking, things like x = x + 1 makes no sense
5) You need "<<-" for the occasional global
6) 2 -> x
Also you can do things like this when you're bored:
((a <- b <- 1) + 1 -> c) + 1 -> d
(Someone also once told me that "=" for normal assignment sometimes fails in unexpected ways in tryCatch blocks, but I don't know how or why.)