You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IMO this is not really that important stuff. I prefer to use =, but when I see <- around, then I align to style in the file that I am writing to. AFAIR our functions definitions uses <- quite consistently.
There is not really any harm (as opposed to what is being widely preached) to have both, assuming people who read data.table code know R. The harm might be only for newcomers to R language, to whom those preaches are probably targeted to. Can we close this one?
Like @jangorecki, I don't think I would have put effort into this either. But now Michael has, it's quite nice to get this out of the way; it's higher value than I thought. It should make PRs easier/faster, particularly as we see new contributors hopefully.
Using =, we don't need to worry about the danger of x<-3 when x < -3 was meant. And since assignment is a function in R which has a value (and -3 is coerced to TRUE silently), this error can go undetected. Using = we don't need to implement and maintain quality control checks to ensure spaces are around every operator. I wonder how many of the people who've been told to use <-, and are convinced <- is best because all the experts agree so it must be right, realize this.
Follow-up to comment here:
#3582 (comment)
Also added to Contributing
There's a decent amount of manual clean-up to do, unless someone has as better regex for catching the valid
<-
usages:I wonder how feasible it is to just blanket replace & then patch in the
=
that cause errors because<-
is required 🤔The text was updated successfully, but these errors were encountered: