R vs Python for Stats

The cluster centers on comparisons between R and Python for statistical analysis, data science, and related tasks, with many comments emphasizing R's superior ecosystem, packages, and suitability for statistics over Python's offerings like Pandas.

📉 Falling 0.4x Programming Languages
3,162
Comments
20
Years Active
5
Top Authors
#8898
Topic ID

Activity Over Time

2007
3
2008
8
2009
62
2010
73
2011
91
2012
131
2013
155
2014
204
2015
234
2016
304
2017
212
2018
248
2019
263
2020
197
2021
277
2022
206
2023
140
2024
213
2025
138
2026
3

Keywords

LeetCode REPL ESS SPSS IME teamtreehouse.com ML APL PyTorch SAS python statistics data statistical language analysis use python data analysis pandas packages

Sample Comments

solomatov Oct 14, 2015 View on HN

Could you give a couple of examples, where R is substantially superior to Python?

BrandonS113 Nov 27, 2022 View on HN

R has much much better statistical packages that R, if it is statistics, you can probably find a package in R to do it, not same with python. And the programming language is much better for statistics than numpy/pandas if a package is not sufficient. I use both, and for statistics have no choice but to use R. For data, I use python.

qualudeheart Feb 19, 2022 View on HN

I`d use R instead. Python is best used as a glue language to access premade libraries.

vdaniuk Nov 4, 2013 View on HN

Should one learn R if one already has some experience in data analysis with Python?

techwizrd Jun 19, 2020 View on HN

I use Python and R for data science, and I've never had any issue with R. In fact, I find that many tasks are much simpler in R than in Python.

whyenot Apr 2, 2014 View on HN

It depends. R has many, many more packages and those packages tend to be more extensively peer-reviewed. If the sort of analysis you are doing wanders out of the mainstream, you are less likely having to code something up from scratch than is the case with python/*. I also find R is a lot more enjoyable to use interactively and for exploring data than python. On the other hand, python is fantastic for larger pieces of code, data wrangling, and any tasks where you can make use of python'

tel Apr 18, 2010 View on HN

R is not such a terrible language, though it is quirky. Unfortunately, yes, you are kind of handicapping yourself. The libraries behind R are, for statistical purposes, infinitely better than Python.

owlninja Nov 1, 2017 View on HN

What can R do that Python can't right now?

brunosaboia Feb 24, 2017 View on HN

As other said, R is the way to go if you decide to work solely with statistics. My opinion towards R is that it needs some improvements, sometimes it feels like a language made for prototyping only. But that is maybe its goal, so in the end it could be a good thing to match academic needs.

jjn2009 Jun 10, 2017 View on HN

I can't speak for top comment but I started learning R and realized that a lot of the primitives which are exposed in python as libraries are just primitives in R and are thus are more natural to use in subtle ways. Once you start thinking in R you think in data and statistics rather than how you deal with data and statistics within a language. This doesn't mean one is actually better than the other unless you want to do generic programing things along your math oriented code then prob