4 ms·
Some reasons I love / use R: Plenty of free high quality documentation and learning materials around R (just read anything by Hadley) Package manager. Super e
by uptownfunk 10y ago
Some reasons I love / use R:
Plenty of free high quality documentation and learning materials around R (just read anything by Hadley)
Package manager. Super easy to find, install, and start using packages.
Open source / Free
Large community of users
Extensive usage by the stats community. (If a new algorithm comes out, chances R there will be an R implementation)
Easy to build and share your own packages via Github.
Easy to link C++ code to your packages.
----------------------------------------------
I love R, but something about how the language feels syntactically, it's not as pleasurable programming wise compared to something like the Python data stack. But with all of the above advantages, I don't see myself switching to anything else in the future for my data science work, unless I have a really pressing need to. The other thing is that the language is so damn popular that the useR conference was sold out in pre-reg. rounds.. Seriously guys, stop using and learning about R so I can get in the conference....
- nol13 10y agoBasically this. Certainly not the worst language (SAS), but intangibly less pleasurable than python or most other common languages I've used. Maybe that's because I'm not a 'real' stats person though and ~ notation still takes me a minute to grok. And there is no challenger on he horizon for it's dominance in available packages. And at least it's not SAS. My theories: A) Stat people use R because because they don't know any better B) Stat people use R because code monkeys use python C) Stat people use R because stat people use R (probably this)
- minimaxir 10y agoD) Stat people use R and Python, depending on what best fits the use case.
- nol13 10y agoYa but the only use case for R over python is because some package is written in it.
- hadley 10y agoNo. R is a language that is beautifully well suited to data analysis and interactive computing. Stat people don't use it simply because we don't know better.
- Myrmornis 10y agoAs a language, one problem is that it is many people's first programming language, and it's a very bad introduction. In particular it doesn't teach people to think in terms of standard data structures like hash maps / dicts. It's bad for the job prospects of lots of grad students who might hope to leave academia.
- roel_v 10y agoA big problem with R is that it's just stats. The other day I wanted to do a simple loan amortization (simple PMT/IPMT in Excel). People say 'use R over Excel!'. Right. There are some clunky barely-working packages in R that do half of what you need and some stack overflow posts that mostly show how to do the other half, but that's no basis to build on. And don't get me started on string handling in R, or that there's no way to get the path of the currently running script, or a dozen other things that are trivial in a general purpose language but are a major pain in R. R is not 'general purpose' enough, and it doesn't have to be useful to write both kernel drivers and database REST frontends, but being able to do things that are math-related and not purely stats - that's not too much to ask for I'd say. Especially because it's not reasonable to ask people whose main job is not writing software to learn multiple languages/tools. (Other recent example I remember: how unintuitive I found it to plot a sine wave and its first and second derivative. My Mathematica-oriented colleague did it in 2 minutes.)
- ldp01 10y agoThere are many things wrong with R but basic plotting functions are one of its strengths. Is this the way you did it? It seems pretty intuitive... a=pi/180 x=1:360 plot(x,sin(a * x)) plot(x,a * cos(a * x)) plot(x,-a^2 * sin(a * x))
- hadley 10y agoOr plot(sin) plot(D(sin)) (Programming from memory on my phone so might be slightly off)
- roel_v 10y agoBut that just draws 3 separate plots. My main problem was the derivative, not so much the plotting (or maybe it was 'plotting an arbitrary function'); but I looked it up and it seems I slightly misremembered what it was I wanted to do. I wanted to draw a cubic spline, not a sine. What I ended up doing was spline_x <- 1:6 spline_y <- c(0, 0.5, 2, 2, 0.5, 0) spl_fun <- splinefun(spline_x, spline_y) p <- ggplot(data.frame(x=spline_x, y=spline_y), aes(x, y)) p <- p + stat_function(fun = spl_fun) p <- p + stat_function(fun = spl_fun, arg = list(deriv = 2)) I still don't quite understand how that derivative works - ?list doesn't mention anything about 'deriv', and there's a function called 'deriv' but I'm not sure how that's being interpreted in the code above. Also it seems recent versions of ggplot2 have geom_xspline() which does what I need (I'm told) but that wasn't in the release version when I was doing it.