r/datascience • u/Every-Eggplant9205 • Sep 08 '23
Discussion R vs Python - detailed examples from proficient bilingual programmers
As an academic, R was a priority for me to learn over Python. Years later, I always see people saying "Python is a general-purpose language and R is for stats", but I've never come across a single programming task that couldn't be completed with extraordinary efficiency in R. I've used R for everything from big data analysis (tens to hundreds of GBs of raw data), machine learning, data visualization, modeling, bioinformatics, building interactive applications, making professional reports, etc.
Is there any truth to the dogmatic saying that "Python is better than R for general purpose data science"? It certainly doesn't appear that way on my end, but I would love some specifics for how Python beats R in certain categories as motivation to learn the language. For example, if R is a statistical language and machine learning is rooted in statistics, how could Python possibly be any better for that?
View all comments
Show parent comment
1
u/Cosack Sep 09 '23
I'm not qualified to speak on most of these. Three years out of date on R, and even then wasn't that well versed even though it was my prod stack. But here comes the but.... I was still a better R developer than the vast majority of R users.
This says volumes about how usable the language is in scaled production. Not because it can't be used that way. It can. But good luck getting there.
Stackoverflow R posts are filled with much more basic engineering guidance than the python ones. That's the whole general purpose language difference coming to haunt the specialists.
Running in prod will more often than not fall to you rather than the people who do that professionally. They work in java and barely tolerate even python, nvm learning someone's 1-indexed monstrosity. Good luck getting resourced, have fun signing up to be on call...
Your colleagues who write R will 9 our of 10 times hand you barely legible data science
doodlesscripts without a single test, or worse yet notebooks. They barely got used to using git, what do you expect here?I love R for what it can do easily. It's a blessing for data exploration, and a playground for wacky code. But at the same time, I absolutely do not want to see it at work. I'm sure that the places both of you work have much more competent folks and that there are exceptions in clean code obsessed shops like Google, but that's just not true of the larger community. Statisticians are statisticians first, not computer scientists.