4 ms·
R is... _interesting_ language. Its main power really comes from the comprehensive libraries that are available. I think there is an interesting option if other
by tpetricek 11y ago
R is... _interesting_ language. Its main power really comes from the comprehensive libraries that are available. I think there is an interesting option if other languages can figure out how to make the R libraries easily accessible in their environments, which is not that easy, because even the libraries can use the _interesting_ R design features :-).
That said, in F# (which is a functional-first language with some solid programming language design background), one can call R functions in a fairly nice way using a type provider: http://bluemountaincapital.github.io/FSharpRProvider/ http://bluemountaincapital.github.io/FSharpRProvider/.
This probably cannot replace R for typical statisticians, but it is a nice option for programmers...
- mziel 11y agoExactly! There are many good languages for data analysis (Julia is one example) but no other language (not even Python, which is BTW leaps and bounds above all the other alternatives) can match the library support and statistical maturity that R has. And R is not so bad as a language. It's OO is really bad, but it has functions as first-class members and great support for NAs. Combined with Hadleyverse and pipe operator (magrittr) is makes a very readable code.
- wrp 11y agoI think the value of all the libraries available for R is overrated (even ignoring the buggy ones). Most of the time, you don't need that kind of choice. I just finished reading _Data Analysis_ by Peter Huber. One chapter is about programming languages for statistics. In the language that he developed (ISP), he included only a small core of statistical facilities because in his experience that's all people really need. David Hand has also written observations along the same line.
- mziel 11y agoIt really depends on what you're doing. If you're a developer tapping into data analysis, sure. But I'm building predictive models for a living and I evaluated quite a few different frameworks and languages. Sophistic algorithms for missing data, sparse solutions, latent modelling. You can find the many industrial grade algorithms in Python, Spark, Julia, Weka etc. but for stats-heavy data science/machine learning R is unmatched. Sans writing your own implementations based on pseudocode, but this is really not effective use of your time for prototyping. EDIT: And even for simple stuff, the strength of R packages is easy to prove since they are either directly ported to other languages (ggplot) or heavily influence the implementation (pandas).
- Lofkin 11y agoWith Pymc3, you can code a bayesian generalization of most of those packages pretty easily. For bayesian models, it is easier than calling into C++ with stan in R. For everything else, one can call arbitrary R packages with Rpy2, albeit with clunkier syntax. For agent based modeling, there is no comparison. Python with its better and faster class system and Numba is in another league. Finally python has distributed and out of core lists, arrays and dataframes: http://dask.pydata.org/en/latest/ http://dask.pydata.org/en/latest/
- blumkvist 11y agoThis is nonsense. Majority of people might not need sem or mlogit, but the majority of the budget in market research most definitely does need them.
- hadley 11y agoI think it's the 80-20 rule at play. You can solve 80% of a problem with the same 20% of the options. But the last 20% is different and you need a very large class of packages to cover the long-tail of needs.
- hadley 11y agoI don't think R's OO is great; but it's mostly misunderstood because it's fundamentally different to most popular modern languages. Interesting Julia, uses exactly the same model as R (I.e. Generic functions not message passing)
- mziel 11y agoMy main criticism is around two things. One, "clunkiness" of class creation (which I guess is subjective); I don't think it's very readable, but maybe that's bias from other languages. Second the S3/S4/R4 mess.
- wrp 11y agoI think it's useful to make a big qualification to the question. Of course, if you need to use a library written in R, then you use R. Same with Java or anything else. So the question is assuming your choice isn't governed by need for a particular library.
- collyw 11y agoI am sure I have seen Python libraries that are wrappers around R. As someone that's never used R, I would try that first.