Profile photo for Norm Matloff

The vast majority of people who answer this question will do so out of bias, not fact. (And in turn, the bias comes from which language one learns first.) This is true whether they answer R or Python.
I hope I am reasonably neutral, having written a book on R and a 151-page tutorial on Python. I will come to R's defense here, though, because even those who said nice things about R made incorrect statements, in my opinion.
For those who object to R on "computer science" grounds, I would note the following:

  1. R is object-oriented. Functions are first-class objects, and can be assigned, modified etc. You actually have a choice of three levels of OOP.
  2. R is a functional programming language i.e. (almost) no side effects.
  3. Operator overloading is much easier in R than in Python.
  4. Python has cleaner syntax than R, but not THAT much cleaner. Really, in terms of syntax, they are quite similar, basically both of them being C-family languages.
  5. Parallelism in R has been much further developed than in Python.
  6. Using Rcpp, interfacing R to C/C++ is much easier than interfacing Python to C/C++.

In my experience, R is easier than Python for "data munging," taming bad or irregular data, transforming data, filtering data, etc. If you add NumPy in your definition of Python, that brings the two closer, but if you then bring in R packages such as plyr and data.table, things strongly tip in R's favor. By the way, data.table is blinding fast.
These days, I do a lot of tasks---nonnumeric tasks, e.g. text processing---in R that I used to do in Python. I'm not saying they are easier in R; the coding effort is about the same, but it's easier for me not to keep switching languages.
As noted, there are over 5,000 packages available for R. For example, when I needed a fast nearest-neighbor function, I went to the R package repository, CRAN, and found that not only was there one there, there were two to choose from. When I needed code to find distances from rows of one matrix to rows of another, again it was right there on CRAN.
Really, you should just program in whatever language you are most comfortable with. But don't write off one simply because you first learned the other.

View 100+ other answers to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025