R Throwdown Challenge
theodp (442580) writes "'R beats Python!' screams the headline at Prof. Norm Matloff's Mad (Data) Scientist blog. 'R beats Julia! Anyone else wanna challenge R?' Not that he has anything against Python, Matloff adds, but he just doesn't believe that Python or Julia will become 'the new R' anytime soon, or ever. Why? 'R is written by statisticians, for statisticians,' explains Matloff. 'It matters. An Argentinian chef, say, who wants to make Japanese sushi may get all the ingredients right, but likely it just won't work out quite the same. Similarly, a Pythonista could certainly cook up some code for some statistical procedure by reading a statistics book, but it wouldn't be quite same. It would likely be missing some things of interest to the practicing statistician. And R is Statistically Correct.'"
Nothing with a name that verbose can possibly be any good.
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
I don't see any margin of error. This claim is scientifically worthless.
An Argentinian chef is more likely to make great sushi than a Japanese automotive engineer.
You generally want to use programming languages designed by experienced programmers (even better, experienced language designers) who work closely with subject matter experts. Left to their own devices, experts are likely to get a lot of things wrong, and if the language is sufficiently popular, you are stuck with their mistakes for a long time to come.
R itself is okay, but even as a long-time user I don't think the language or environment itself is all that much to brag about. What makes it great for statistics is just that statisticians use it, which means that a lot of the packages are written by statisticians. That makes a big difference: recent papers often have R implementations, standard problems have well-maintained R packages for them with all the bells and whistles, etc. As Matloff notes, this means they often have everything that statisticians are looking for, while straightforward textbook implementations you often find in other languages often aren't nearly as thorough in how they handle the statistical models, or only handle some special cases (though there are some really good packages in other languages, just not as many).
But I don't think that has much to do with R itself being uniquely suited to statisticians. It's used for historical reasons: Bell Labs S was influential in the field way back when nothing like Python or Julia existed, and statisticians started using it because it was a lot nicer than Fortran, which is what other areas of science mostly used back then. GNU R is essentially a free-software workalike for Bell's S, and it's kept most of the community on board through a mixture of existing packages, familiarity, and inertia.
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
Python, C, Mathematica and R all have different strengths for mathematical work / numerical calculations though, and using the best tool for the job is what it's about. As always, what the best tool actually is, is also rather subjective, as which tool will best solve a specific task is always dependent on your skill with the different tools. I do agree with professor though, even though there's quite abit of Python hype (python + scipy/matplotlib is amazing) R is not being replaced anytime soon. It's too good at what it's good at.
"" How about taking the safety labels off everything, and let the stupidity-problem solve itself? """
A joke I've read recently:
I'm not sure if "R is written by statisticians, for statisticians" is a good thing e.g. "stadiums are built by footballers, for footballers"
Use the right tool for the job and stop bashing other tools that were designed for different jobs .
---- Booth was a patriot ----
Hrm. I never thought about the whitespace requirements in python from an accessibility perspective.
You got the title wrong.
_Numerical Recipes in C_, by Press, W. et al
http://www.amazon.com/Numerical-Recipes-Scientific-Computing-Edition/dp/0521431085
IIRC there was also a _Numerical Recipes in FORTRAN_ as well.
Also see http://www.nr.com/ . I think they only have a single book now called _Numerical Recipes_ and it is in its third edition.
Does R invent new syntactic constructs that make it useful for handling/generating statistical data? So far I've not seen any new syntax in R that warrants creating a new programming language -- it's just a rehash of various scripting languages already available.
From a programmer's perspective, R should just be an easy to use library that you can use in various languages like Python, Julia, Ruby, etc. There's no need to learn new syntax if it's not that new and useful.
How about the syntax for specifying model?.
lmfit = lm( change ~ setting + effort )
"Arrrr.... fix yar name 'R' while you may, maties!!"
I may not have the belly for Deep Statistics but I do know abut Internet Search noise levels. I remember trying to do research on WebDAV (believe me, there is such a thing) only to discover that folks discussing it invariably refer to it as 'dav'. Because saying "Distributed Authoring [and] Versioning" out loud makes you spit out your toothpick. Any attempt to search 'webdav' yielded only the sterile official pages, and attempts to search on 'dav' with other keywords brought up conversations from the community of Disabled American Veterans who also use the term in casual conversation, and have said an awful lot over the years. They occupied 'dav' first.
Now you may think you can pull off a 'C' where Google seems to pick off relevant results if you combine it with any computery term, but it was not always so. It has taken an incredible saturation of C, and perhaps some special coded cases on Google's part, for this to come about.
The success of Perl is due in some part to the ability of confused people to obtain help and advice about it merely by searching on its unique spelling.
So the best way to push this R language is with a refit of the name. Go with the pirate theme, it will sell many more T-shirts than those of silly camels and pearls. But stake out a bit of Keyword Real Estate that presently has a relatively low population density.
Google search result estimate counts, descending order,
r --- 2,730,000,000
ar --- 656,000,000
arr --- 24,400,000
arrrrrrrr --- 3,060,000
arrrr --- 876,000
aarr --- 638,000
arrr --- 536,000
arrrrr --- 405,000
aaarrrrr --- 267,000
arrrrrr --- 205,000
arrrrrrr --- 129,000
aarrr --- 107,000
aarrrr --- 107,000
aaarrr --- 56,600
aaarrr --- 56,600
arrrrrrrrr --- 52,400
Adding arrrs is not enough since talking like a pirate is typically accomplished with a single 'a', so ar+ space is pretty well populated up to ar{5}, it looks like best ratio is around a{3}r{3}. But even choosing the less-optimum and easier to type a{2}r{3} by using 'aarrr' instead of 'r' you have improved the signal to noise ratio by a factor of twenty-five thousand.
Push the name change firmly and decisively. This means that if anyone mentions 'R' there should be immediate responses that ask, "What AARRR you talking about?" This will inject the proper searchable term into the discussion while it reminds the poster of the name change.
For an interesting 9 minute lecture that might help sell you on this idea, listen here.
<blink>down the rabbit hole</blink>
For a nice video on using ipython notebook in data analysis: https://www.youtube.com/watch?...
For a nice selection of ipython notebooks for doing various type of data analysis: https://github.com/ipython/ipy...
Believe it or not, most statisticians are not programming wizards.
Most stats guys use R, matlab, mathematica, or something similar. Even if it takes days to run a program that would take 20 minutes in C. Sort of like how the business guys will use VBA when they need anything, because that's what they know.
Languages like R are used because they are accessible. And once they reach a critical mass, everyone learns them in a field.
Sort of like how Fortran just won't die.
Having seen the state of programming in the Sciences, I really do not thing that "built by statisticians" is something you would want to advertise.
Troll is not a replacement for I disagree.
A few examples are provided in TFA but it's all rather vague as to why R "beats" Python. I've been using R for years for fitting mixed effects linear models. It does this really well, it makes it easy to compare models, it's got all the cutting-edge stuff in it. The problem with R, however, is that it's shitty and unintuitive as a programming language. I do all my pre-processing in MATLAB and I only ever export to R when I have a final data frame that needs a moderately complicated statistical analysis.
soylentnews.org
And to what extent are statisticians willing to use warez?
Don't forget the influence of history: R wasn't designed for superiority to Python, Julia, and Ruby; but in large part to be a GNU-acceptable implementation of S, which may well have been designed for superiority to APL and FORTRAN; and which has existed since somewhere between the-before-time-when-the-gods-were-young and the start of the Second Trilobite War.
He's probably right. All other things being equal a good Domain Specific Language will crush a General Purpose Language in its domain. If Julia is much faster than R and that were unfixable it would still be far easier to write a library in Julia accessible by R than to train R users in all of Julia's concepts.
General purpose languages can sometimes get close to DSLs in effectiveness and then the greater diversity of users creates an economy of sacle and deep entrenchment which drives DSLs away. But then with a large and highly diverse user base the General Purpose language isn't able to rapidly adapt so DSLs spring up to fill niches. Some of those DSLs become incredibly successful and start to move into other domains diversifying their purpose and user base to become General Purpose Languages and the cycle repeats.
Completely right.
We use R extensively in work. Programmers talk about R's libraries, but that's not the real reason we use it. The killer blow is that the _documentation_ is written by statisticians. That means that it's reliable, easy to understand, and honestly tells you the pitfalls of the techniques you're using.
We're financial guys who are doing stuff in consumer finance that has rarely, if ever, been done in our field. The statistics aren't particularly advanced, but it's impossible to hire someone who understands the industry and knows the statistics already. Statistics text books tend to either be so basic that you already know what they say, or so advanced that you need a PhD to understand them. On the other hand, much of the R documentation is beautifully simple to read, and comes with brilliant worked examples - albeit from fields that are very different from our own. Whenever we're researching potential new statistical approaches, we find blogs stuffed full of examples written in R.
In short, the R ecosystem makes you a better statistician. Julia and Python can't offer that.
From the summary:
And R is Statistically Correct
But Python is correct all the time.
If Pandora's box is destined to be opened, *I* want to be the one to open it.