Is it just a style preference?
As far as I can tell, they are the same.
I see many people prefer the “longer” <- version and I can’t tell why (perhaps keeping away from = and == confusions?)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, they are not exactly the same: the
=operator cannot be used everywhere that<-can.There are also differences in scope. See this answer for more details.
Which is better depends on who you ask.
Reading from "Introducing Monte Carlo Methods with R", by Robert and Casella:
Source
On the other hand, Google’s R style guide recommends using
<-: