4 ms·
The common trope with R is that statisticians and love it and developers hate it. The the main reason that statisticians love it is that the libraries useful t
by em500 5y ago
The common trope with R is that statisticians and love it and developers hate it.
The the main reason that statisticians love it is that the libraries useful to them are much better in R than elsewhere (though Python keeps encroaching in that turf, and "real developers" dislike Python a lot less than they do R).
The main reasons that developers hate it is that it is very unlike almost all other languages that they're used to. This is very valid since outside the narrow domain of statistics, there's probably nothing that R does better than other languages. So for a dev who occasionally dabbles with R by necessity, the otherness serves nothing but frustration.
Still, I wonder how much criticism there is against R as a programming language, that is not some variation on this works very differently from other languages. IMHO the sub-setting syntax, and countless x-apply variations are big warts. I'm not a big fan of Tidyverse, and even less of the schism between base- and Tidy-R. I read some seemingly fundamental criticism about R's deficient scoping rules, but I'm not nearly knowledgeable enough to judge their merits.
I guess it doesn't help that almost nobody learned R as their first computer (as opposed to statistics) language. Personally, I learned C, Matlab, Python/numpy, SQL, R in that order. R does seem to be quirkier than all the others, except maybe SQL. But I don't dislike working in R any more than working in any other language.
- pantulis 5y agoI had some Matlab experience about 3 decades ago. What's you take in Matlab vs R as programming languages?
- em500 5y agoIf signal processing and matrix algoritms are your thing, you should (and probably would) be using Matlab. Most statisticians don't really do much of that, what they mostly do is data management and try to mold their tables in some form accepted by an existing R package (or even Stata). As far as I remember, Matlab was pretty horrible for data munging, even worse than R for anything non-numerical. But my Matlab experience is also almost 2 decades old, so I don't know if it's any better today.
- tomrod 5y agoNot the grandparent. Matlab is much simpler for matrices than R, approaching Python's numpy is ease of use (and very reminiscent of Fortran and Julia).
- yarky 5y agoI've had to translate a lot of Matlab to R in college (physics and econometrics). I rarely found an important difference between the languages besides having to transpose some matrices here and there.
- horsawlarway 5y agoMy take is that Matlab is better in basically every regard, with the exception that the same functionality will cost you a considerable amount of real world money. Having used both in a professional setting - and coming in with a fair bit of programming experience - Matlab is generally a pleasure to use. It's different where it needs to be in order to treat matrices as first class citizens, but otherwise you can apply many of the same intuitions and paradigms that you would in any other language. R on the other hand... R is a fucking disaster of inconsistency. I find myself incredibly frustrated attempting to do simple and sane things - things that I know are only a line or two in Matlab (or even python) and instead fighting with "which version of the 12 different slight variations of this operator are you attempting to use today!" hell scape. My strong guess is that if you have no coding experience, and you learn R fairly thoroughly - it will feel very nice. My problem is that for anyone with actual coding experience, it's like being given a keyboard with a qwerty layout, but which is actually using dvorak. All your intuitions are pointlessly wrong - not because they are actually problematic, but because R has decided that the A key is really on the other side of the fucking keyboard.
- edgyquant 5y agoBut isn’t the consensus that R is a better language? At least that is what the cool kids said when I went to college (I never used Matlab except maybe a handful of times.)
- horsawlarway 5y agodefine "better"? They each have a few strengths over the other, but generally speaking, I much prefer the language consistency of Matlab. My general experience is - industrial shops will be using Matlab. Almost all of my Matlab work was aerospace related (think sigint/radar/signal processing/modeling). R is more popular in education environments - but I strongly suspect that's just because it's free. Post-grads don't have much lab funding to work with at the best of times, and Matlab with an associated set of plugins/libraries specific for your task can easily run 30k a seat. Personally - I find it pretty telling that most places with money choose Matlab. Doesn't inherently make it better, but it does mean Matlab is getting used in places where mistakes are expensive, and there's a focus and consistency to the tooling that I just think is desperately lacking in R.
- yarky 5y ago> it doesn't help that almost nobody learned R as their first computer (as opposed to statistics) language. Aside from two statisticians I had as professors, I am yet to meet someone with deep understanding of statistics who doesn't speak R as first language ... I found it way easier to grasp the meaning of statistics by playing with R than by reading the maths.
- jmt_ 5y agoI used RStudio to work through problem sets, textbooks, and ideas constantly during my time as an applied math student. My concentration was stats, but still found RStudio invaluable for pretty much every math class I took. I say RStudio specifically because it offered the complete package for what I needed at the time. Built-in graph viewing, workspace management, etc. As another commenter said, pretty much the best graphing/scientific calculator I could ask for.
- edgyquant 5y agoYou’re right, but I’d would think in recent years most stats people would have python as their first language. It probably comes preinstalled on their OS at this point (not sure if this applies to windows outside of WSL yet.)
- Breza 5y agoPython has a big advantage in deep learning but R still has an edge in classical statistics.
- twomoonsbysurf 5y ago
- mellavora 5y ago> "real developers" dislike Python a lot less than they do R I thought that was real Scottmen. Because real Scottsmen prefer: table.loc[(table.column > 2) | (table.column2 < 3)].reset_index(drop=True) to table[column > 2 & column2 < 3, ] and everyone knows this! not to mention, if you aren't managing 100 virtual environments and 100 conda environments (with different syntax for requirements), you aren't a real scottsman!
- em500 5y agoYes, I definitely put that up as a real Scotsman. The "real (Java) engineers" at my company scoff at the loosey-gooey attempts of the Python engineers trying to productionalize the numpy mess produced by our ML-engineers. I mean, how can you "productionalize" anything without Builders and Factories?
- maleldil 5y agoYou can do table.query('column > 2 or column2 < 3') If you want. I'm not sure why you're dropping the index there.