Re:Introduction to R Programming
by mannykannot on Thursday December 07, 2017 @06:32AM
(#15869212)
I don't get how a keyboard shortcut deals with the '<-' issue, which is the occasional and subtle difference in semantics from '='. Even if you can pick just one for your own work, it doesn't help with other people's code.
Tidyverse is new to me, I must check it out.
RStudio shortcut for <- is alt and -.
Also Tidyverse and data.table are the main reason for the sudden explosion of R's popularity. For me I love the piping since I am an old time bash user and | becomes %>% in R is the best thing for the way i think.
Re:Introduction to R Programming
by mannykannot on Thursday December 07, 2017 @07:23AM
(#15869432)
Typing '<-' is a fairly trivial matter, I think, compared to the semantic issues raised at the start of this thread, and covered in the question and answers below - for example (from the chosen answer): "R's syntax contains many ambiguous cases that have to be resolved one way or another. The parser chooses to resolve the bits of the expression in different orders depending on whether = or <- was used."
https://stackoverflow.com/questions/1741820/assignment-opera...
Just use the '<-' all the time, except in function calls.
If you can use '<-' with an easy key press you will not be tempted to use '='. And the problem is greatly reduced.
But yes, the problem is still there.
But I would give R a try with the tidyverse, it made me go from hating R to just not caring about it.
While libraries are extremely inconsistent, if you want to use cutting edge statistical methdos as a researcher, you pretty much have no other option. Finally, data wrangling is quite well developed in the R evironment.
So long story short, after many years of hating R, now I just find it a handy tool to do my work despite it being old, inconsistent and sometimes annoying.