4 ms·
I've had to learn R during my master (in statistics), and found the process very unpleasant. There are different ways in which a language can be difficult to l
by abraxasz 14y ago
I've had to learn R during my master (in statistics), and found the process very unpleasant.
There are different ways in which a language can be difficult to learn. Haskell has a steep learning curve because it has a lot of unusual concepts (for those who come from an imperative background) and requires a shift in the way we think about code. J is also difficult to learn because the syntax is crazy, and again, the language is very different from what we're used to.
I found R difficult to learn because it is seems inconsistent to me. Now one reason might be that I picked up bits of R here and there without taking the time to learn the syntax from a book (unlike what I did for other languages), but it took me quite some time to be able to make sense of the different structures (vector, list, matrix, dataframe), their differences, and in particular how functions operate differently on these structures. I also have a deep hatred for the system of attributes (why would anyone want to give attributes to a vector...), and find the indexing system (especially for lists) to be nonsensical. In fact, I think that lists themselves are terrible to work with.
The general impression that I've had learning R is the language is not coherent and systematic in its design in the way other languages are (I know python, c, common lisp, ...), and I find myself spending a lot of time in the interpreter simply trying out things because I'm not sure that it will return what I want, in the format that I want (which never happens to me in any other language).
Now don't get me wrong, I use R daily and it's a useful tool. It has lots of great libraries, including the fantastic ggplot2, and the remarkable Rcpp (best C++ interface I've ever seen.. ok I haven't seen any other, but this one is really great). But learning it was no fun, and if the statistics community decided to move to a cleaner language, I'd definitely be running ahead..
- EzGraphs 14y agoIn R, I often can write a dozen line program that will do something incredible, but it might take an hour to hammer out those lines and cannot reconstruct them from memory because of inconsistencies in syntax. It sort of feels like a statistics DSL built on Lisp.
- pseut 14y agoR is exactly like a statistics DSL built on Lisp. The first sentences of a talk by Ihaka [1] are: > R began as an experiment in trying to use the methods of Lisp implementors to build a small testbed which could be used to trial some ideas on how a statistical environment might be built. Early on, the decision was made to use an S-like syntax. Once that decision was made, the move toward being more and more like S has been irresistible. Since I find it basically impossible to remember how 'eval', 'quote', 'substitute', etc. work in R, I suspect that the Lispers are onto something when they say that the lack of syntax in Lisp is an important feature. [1] http://www.stat.auckland.ac.nz/%7Eihaka/downloads/Interface98.pdf http://www.stat.auckland.ac.nz/%7Eihaka/downloads/Interface9...
- RockyMcNuts 14y agoR makes the hard things easy and the easy things hard.
- groovy2shoes 14y ago> I found R difficult to learn because it is seems inconsistent to me. Now one reason might be that I picked up bits of R here and there without taking the time to learn the syntax from a book (unlike what I did for other languages), but it took me quite some time to be able to make sense of the different structures (vector, list, matrix, dataframe), their differences, and in particular how functions operate differently on these structures. If it makes you feel any better, I've read several R books and they normally present it in an inconsistent manner as well. I've written programs in some 30 languages over the last 13 years, and I've yet to encounter one that's as difficult to pick up as R. Materials that purport to teach R are, in my experience, almost always presented as a set of recipes for very specific statistical methods. That approach stands in stark contrast from traditional programming introductions that attempt to teach general concepts rather than specific how-tos. I agree, though, that despite the learning curve, R is rather useful.
- hadley 14y agoI'd appreciate any comments on https://github.com/hadley/devtools/wiki https://github.com/hadley/devtools/wiki - it's my attempt to teach R like a programming language, focussing on cross-cutting concerns and general concepts. It's still a work i progress, so your feedback can help make it better.
- abraxasz 14y agoI read it cover to cover (so to speak) about two weeks ago, and although still a work in progress, it is indeed the best written guide to R that I've read to date. It appealed to me because it insisted on the functional programming side of R, and explained some of the intricacies and advanced concepts in R. It's pretty dense though and will certainly require a number of re-reads before I internalize all of the material. One thing I would find very useful is a case study on how to design more complex packages. In particular, I would love to have an executive summary of the inner-working of ggplot2 and/or ddply. In particular, how can I manage to pass formulas as arguments to my functions, how can I achieve the pseudo DSL effect of ggplot2, etc... I know, I could read the source on github, but ggplot2 is pretty big, so a summary would be helpful.
- Hansi 14y agoI've been working with R 90% of my time over the last two years and I agree it's a freakishly inconsistent language. Me and the team I work with are still finding out weird completely illogical errors that effect the language but I think I've somehow started loving it despite all it's flaws and I did actually semi-enjoy the process of figuring out all those little wtf issues. For those starting out with it reading this book + r inferno helps a lot with understanding the underlying weirdness and inconstancies of the language: http://www.amazon.co.uk/The-Art-Programming-Statistical-Software/dp/1593273843/ http://www.amazon.co.uk/The-Art-Programming-Statistical-Soft...