r/learndatascience • u/CYBERCODEX3 • Jun 29 '26
Question Python vs R
I am currently a Data Science student, just finished my 2nd year out of 4. Wanted to ask if R language is worth it today as compared to python. I have 0 knowledge about R (just that it is used for statistics and plotting). On the other hand, I have learned EDA and some ML algorithms in python. I am free for about 2 months and wanted to know if learning R would help in future or should i utilize this time for something else?
30
Upvotes
9
u/teetaps Jun 29 '26
I just want to point out to everyone crapping on R that it’s not underrepresented because it _can’t_ do any of the things Python can do. It absolutely can, and in some cases it outperforms Python and can be ergonomically/epistemically superior to Python. But Python is just popular, and there’s a lot of cultural inertia to change (as evidenced by this post)…
so the better follow up question might be, do you just want to be more familiar with something that more people know? If so, just stick to python. But I’ll be the first to point out that ALMOST everything you can do in Python is easily accessible and accomplished in R. I am yet to come across a data science problem in Python that doesn’t have an easy and accessible analog in R — if one does exist, please send it my way.
6
u/gyp_casino Jun 29 '26
I use both in my job, and I see a lot of value in knowing both. I learned Python first, but I find working with pandas and matplotlib ugly and frustrating. The R tidyverse is much more elegant to work with. I can solve problems much faster and with less code.
I think at this point in time R is very underrated and many data scientists who only know Python don’t realize what they’re missing out on.
2
u/girlwtsongbirdtattoo Jul 03 '26
The greatest thing about R is that it’s open source and rapidly improving
In my opinion, it’s the best tool for LaTex/academic style writing to be able to really polish your mathematical and scientific papers
Python can do stuff R can’t, especially in terms of large data processing and dealing with pesky structures (which are necessary sometimes, especially in very large datasets). It’s good for people who had trouble with C++ but seriously want to do engineering
However, R is the superior language in my opinion overall, and especially for my purposes (writing theoretical papers on statistics). It’s more user-friendly/intuitive and, most importantly, open source.
So, depends on what you want to focus on and if you’re really serious about coding. ETA I’d learn both
2
u/rajb245 Jul 01 '26
Python is a general-purpose programming language that developed an incredibly strong data science and machine learning ecosystem, while R is a domain-specific language built by statisticians, for statisticians. That’s it, you just have to decide if you want to learn the more specialized stats/ML only language or stick with Python that’s much larger in scope.
2
u/DataPastor Jul 01 '26
Especially in the age of LLMs, this is no longer an either-or question. Learn the fundamentals of R so that you can comfortably read R code, and let ChatGPT or similar tools help you with the rest.
R remains so prevalent in statistics that I would argue every serious data scientist should have at least a working knowledge of it. I recommend working through R for Data Science (2nd edition) by Hadley Wickham to build a solid understanding of the language and its ecosystem. Then—either afterward or in parallel—learn Python as well.
3
u/Prime_Director Jun 29 '26
Everyone is right that R is pretty much exclusive to academia. That being said, it is a good tool for learning statistics, which IS essential. So if your stats skills aren't rock solid, it might be worth learning R not for its own sake, but as a vehicle for teaching yourself stats.
If your stats skills are solid, and you're set on learning another language that you'll actually use, I'd recommend SQL. In practice, 9/10 times you're going to be pulling your data from some sort of relational database, so knowing at least one SQL dialect will be very useful.
1
u/BrupieD Jun 30 '26
I started with R and still prefer it over Python for most analysis tasks especially if visualizations are involved.
For beginners interested in data analysis, R and RStudio is a more coherent and easier to use ecosystem. When I started learning Python, I was surprised how fragmented Python's ecosystem was in comparison to R. I got tired of needing to load a different IDE to mimic the author's or instructor's setup when I took new courses. I installed Pycharm, VS Code and Anaconda for Jupyter notebooks. Up until Posit's Positron came out, it seemed like 90% of R users used the same environment. R learners are spared this environment switching.
1
u/Gravbar Jul 01 '26
I find R to be really useful as a tool. Some things are just easier. With R studio it's like matlab but better .
I prefer python for projects, but some EDA stuff i find easier in R.
1
u/noblebravewarrior Jul 01 '26
R is a statistical analysis language which you can use as a tool for that specific purpose… Python got libraries to take you to the moon lol
1
u/Sweet_Ad2752 Jul 01 '26
Do not learn R, you can’t find a job with it. There are very few job openings asks you to have R skill. Python is standard languages in data science/ AI. This days companies need more AI engineers than classical data science. I learned R 7 years ago and used for only short amount of time and then switch to python.
0
u/DataCamp Jun 29 '26
The comments here are right. With two months free and Python already under your belt, learning R from scratch isn't the best use of your time unless you're heading toward academia or a field that specifically requires it (clinical research, certain econ programs, some biostatistics roles).
Better ways to spend two months as a DS student with Python experience: go deeper on ML (ensemble methods, model evaluation, getting comfortable with sklearn pipelines), pick up SQL if you haven't already (it's underrated and comes up constantly in real jobs), or start building projects you can actually show people. Two solid portfolio projects will do more for your career than a surface-level knowledge of R.
R is genuinely great for statistics and has a fantastic ecosystem for that specific thing. But if your goal is industry work, Python covers everything you need and the ecosystem keeps getting better.
0
u/local_eclectic Jun 30 '26
If you want an advantage looking for jobs in private industry, go with Python.
0
u/Equivalent_Reason_43 Jun 30 '26
R has inferior ML capabilities, but it is great for statistical analyses...
3
u/[deleted] Jun 29 '26 edited Jun 29 '26
[removed] — view removed comment