3 ms·
E.g. can you quickly spin up a REST-like HTTP interface for your goods? On the contrary, it started life as a Bell project called S, more or less a math/stats
by nerdponx 8y ago
E.g. can you quickly spin up a REST-like HTTP interface for your goods?
On the contrary, it started life as a Bell project called S, more or less a math/stats DSL. It was implemented in GNU as R, and R became one of many competing "stats packages" you may or may not be familiar with: SAS, Stata, SPSS, etc.
While it can be used for general purpose programming, its main advantage is that it is still primary a math, statistics, and data analysis DSL at heart. The concept of a "data frame" (which you are familiar with if you've used Pandas) as a data structure originated, as far as I can tell, in R. Data frames are built into the language, and the language offers custom syntax support for them.
Also, the standard library is full of high-quality statistics tools. Fitted model objects have handsome, human-readable string representations. The formula DSL is elegant and convenient. Manipulating data (replacing missing values, etc) is easy and relatively concise. Math and linear algebra is similarly and it is linked to BLAS so it's pretty fast. Plotting is built into the language and it's pretty intuitive, even if the defaults aren't that pretty. The language is also fully homoiconic and wildly dynamic, allowing you introspect and modify pretty much any chunk of code.
And all that's just in the standard library. The package ecosystem is downright enormous. You can write R packages in C/C++ just like in Python if you need something to go fast, aided by Rcpp. There's Shiny, which is a self-contained HTTP server for data-driven web applications. GGPlot2 was a minor revolution in elegant data visualization. The Tidyverse package collection was similarly mold-breaking by letting users write organic "data pipelines" instead of imperative code. Caret is at least as good as Scikit-learn for general-purpose machine learning. XTS takes the pain out of time series manipulation and modeling. Data.table can efficiently join and subset billion-row datasets in memory using indexes. The list goes on.
Long story short:
- domain-specific niceties
- batteries-included standard library that mimics features found in big monolithic stats packages
- has general-purpose programming capability
- extensible in C for speed
- built-in plotting that's not perfect but it's pretty good
- huge package ecosystem.
- claytonjy 8y ago> Caret is at least as good as Scikit-learn for general-purpose machine learning Oh how I wish this was true! Luckily RStudio hired the author of Caret to develop a family of smaller tidy modeling packages (https://github.com/tidymodels https://github.com/tidymodels), and with recipes we're finally close to having something like sklearn's Pipelines, which IMO is one of the best parts of sklearn.
- nerdponx 8y agoTrue, the pipeline is a great feature. I haven't used tidymodels yet but it looks like the start of a great ecosystem. I do remember seeing Broom at a talk a couple years ago and thought it was a nice idea.
- thanatropism 8y agoThat's interesting. I used to be a professional user of Stata, really day-to-day stuff; but I never saw R positioned as an alternative to Stata.
- nerdponx 8y agoI only used Stata in school but that's how it turned out for me. "Why learn Stata, SAS, or SPSS when I can just use R?" It made no sense to me (and still doesn't, honestly).
- jasonpbecker 8y agoTons of former Stata users are now R users, especially over the last decade. Stata pretty much lives in Econ departments now.