>I found the syntax baffling, the documentation copious, but written for mathematicians instead of hackers
I'm always surprised how much people hate the syntax of R. I primarily work in Python, but I use R once or twice a week... and the syntax seems very clean to me. Can someone give mee an example of what you dislike with R's syntax?
I'm even more surprised to hear complaints about the documentation in R. The help files in R are much more complete and well organized than docstrings in the python libraries we use. Even the web usually lacks anything as useful as what I get from the vignettes function in my R interpreter.
Personally it's not so much syntax as the confusing data model that gets me in R. So many different but very similar data types - lists, data frames, matrices, tables, vectors - all very similar but slightly different syntax, very frequently converted silently from one to the other when you call functions but resulting in strange quirks that are extremely hard to debug at the other end. The combination of loose data typing and this plethora of similar data types makes it a nightmare to work with at times. On the other hand when you grok it and it works for you ... it's amazing.
The complaints about R still seem counterintuitive to me. Python has the same data types listed above, and many more.
A list in R is a list in Python.
A data frame in R is a date frame in the pandas library.
A matrix in R is a matrix in numpy.
A vector in R is a 1-dimensional ndarray in numpy.
But Python adds dictionaries, tuples, iterators, sets, and a bunch of other data types that aren't used in R.
R's lists and vectors are relatively similar... but you could say the same thing about numpy's matrix and ndarray. You could probably say the same thing about python's sets, tuples and lists.
To be honest, I'd have said the strength of python is that it has many more data types than R... rather than fewer data types.
(Author here) - I don't have any specific examples, but I was learning R and Python at the same time. I found Python to be very practical and easy to learn. When learning R, I kept getting tripped up. Maybe it isn't that R was harder, but that I had a head start on Python. And as for documentation, R was certainly very complete, but once again, I found it harder. I think because R is written by, and probably for, professional statisticians and mathematicians, it needs to have a different level of rigor than the Python documentation. Anyway, sorry for the lack of specificity.
R does have some weirdness (it took me ages to understand the index and slice notations), but it is very expressive.
I'm not a mathematician, and I've been programming Python for 15 years, but I'd always pick R for its stated problem domain given a choice.
I highly recommend "The Art Of R Programming" for learning R as a programming language. The statistical side of things are then easier to layer on top of that.
I'm always surprised how much people hate the syntax of R. I primarily work in Python, but I use R once or twice a week... and the syntax seems very clean to me. Can someone give mee an example of what you dislike with R's syntax?
I'm even more surprised to hear complaints about the documentation in R. The help files in R are much more complete and well organized than docstrings in the python libraries we use. Even the web usually lacks anything as useful as what I get from the vignettes function in my R interpreter.