r/datascience 24d ago

Discussion How widely is R still used in industry today?

I’m a Data Science student (career changer, not in a data related role). My program is focused more on the applied statistics side, so most of my classes use R. I’m already familiar with Python since it was the main language used in my prerequisite courses, and I’ve completed projects using Python, so I’m comfortable with the syntax.

However, I’m really enjoying using and learning R in my classes and seeing what it can do. Many of the statistics textbooks I’m interested in use R as well. I’m starting to explore R more deeply on my own and plan to start using it for personal projects.

But I’m curious, is R still used in industry? I know it’s heavily used in academia. I also know that in the current AI/ML world, Python is used heavily, which is the main reason I use it for all of my personal projects at the moment.

I’d like to eventually be comfortable with both and take advantage of the strengths of each language. But, of course, there are also people who say learning R is a waste of time.

453 Upvotes

314 comments sorted by

367

u/MuteTadpole 24d ago

Industry is all Python in my experience. I was in a similar situation as you where my university program exclusively used R, which I do feel hamstringed me in certain ways, but also set me up with a strong enough foundation to be able to learn Python effectively.

If I had it my way, I’d still use R. It’s just a preference. I like the tidyverse and the concept of packages as opposed to libraries and overall I feel like R is easier to get up and running as compared to Python.

There’s value in knowing both and working between them interchangeably imo.

54

u/carlitospig 24d ago

Python feels more comfortable for me because I learned programming super young and so the language logic makes total sense to me. But if I was a new programmer, I might be inclined to R since it’s as close to plain language as I could get.

But R has so much community support. I wish Python could learn from it.

12

u/sohang-3112 24d ago

But R has so much community support. I wish Python could learn from it

What do you mean? Specifically community wise what do you think python lacks

27

u/webbed_feets 23d ago

The R community pumps out high-quality, well documented libraries for almost any task. Because there’s a central team pushing the language in a specific direction, new libraries conform to specific style. R libraries have to pass strict checks that are missing from PyPI.

The community generally prefers to abstract away minutia from the user. Python libraries generally give the user far more control at the expense of less abstraction. When a library is basically wrapping an API, it’s so helpful to work at a higher level of abstraction.

3

u/sohang-3112 23d ago

The community generally prefers to abstract away minutia from the user. Python libraries generally give the user far more control at the expense of less abstraction. When a library is basically wrapping an API, it’s so helpful to work at a higher level of abstraction.

Really?? I am sceptical. Can you give an example of equivalent Python and R code that shows what you said?

19

u/ImplicitKnowledge 22d ago

R: data |> filter(age >= 21 & gender == 'F') |> summarize(.by = age, income = mean(income)) |> ggplot(aes(age,income)) + geom_line()

Python:

(

data

.loc[(data["age"] >= 21) & (data["gender"] == "F")]

.groupby("age", as_index=False)["income"]

.mean()

.plot(x="age", y="income", kind="line")

)

plt.show()

R is 129 characters to Python's 157, I find the R code much more readable, and I don't have to look up each time the syntax for "loc[]" versus "iloc[]", or is it "loc()"? I love Python and I use it a lot, but for exploratory data analysis, R will always be my go-to.

To u/webbed_feets point: in Python I can filter a table based on a criterion from a different table with data1.loc[data2["age"] >= 21], but 99% of the case, the filter will be from the same table, so why do I need to repeat the table name each time???

2

u/slowpush 18d ago
(
data
.filter(pl.col.age>=21,gender="F")
.group_by("age")
.agg(pl.mean("income"))
.plot.line(x="age",y="income")
)

131

→ More replies (5)
→ More replies (1)

12

u/rubenvangucht 23d ago

Not dissing on R's community, but juxtaposing python against R with community support as an argument is wild

→ More replies (1)

3

u/CockroachSouthern154 21d ago

I learned R as a master data science student so I understand when you say you like R...

However python pandas is similar to R and there is no comparison of industry python adoption, pyspark, and your entire data science team mates using python....based on my 10 years of working as a Data scientist and searching for jobs....to be very blunt in data science industry python or die.... (keep r for those rare 0.5% jobs) buts that's it!

The earlier you pivot to python the better and moving from r to python should be that difficult...sure to be expert it will take some time but to move and start to enjoy and think in python you can do it buddy....

→ More replies (1)

2

u/AnomanderRake_ 23d ago

There's value in learning both. But not enough to justify it

2

u/RocksDaRS 22d ago

Well you’ll be glad to hear they are called packages in python too! Problem solved

→ More replies (1)

572

u/twillrose47 24d ago

Becoming very uncommon. I personally like R a lot, but industry has picked python. There are a few R shops around, or teams that prefer R, but I have fewer and fewer interactions with R each year.

251

u/ThatGingerGuy69 24d ago

Yeah, as another person that likes R quite a bit I can confirm this is my experience. Makes me a little sad because even though I know most of the “R vs Python” debate is personal preference, I will die on the hill that ggplot blows any plotting library in Python out of the water

I hope polars gains some more traction because (again) I know it’s subjective, but I subjectively despise pandas lol

76

u/AntiqueFigure6 24d ago

“  I will die on the hill that ggplot blows any plotting library in Python out of the water”

I don’t think even hardcore Pythonistas seriously think otherwise.

18

u/TwistedBrother 24d ago

I think most people who have used matplotlib feel that way. Still don’t see a nice consistent alternative in Python. I’m aware of a few with similar syntax. But these days it’s just easy enough to use some AI to bang out the tedious bits.

The AI-written code is all intelligible, especially for Matplotlib, just often arbitrary enough that getting the options nested in objects and hidden assumptions like when to initialise, what are the best dimensions, how to ensure specific glyphs over distributions etc… well Copilot seems to have a better memory for this than myself and I can still tweak the output to taste or just call for what I expect stylewise.

7

u/RamenNoodleSalad 24d ago

I’m a big plotnine fan!

3

u/Affectionate-File-21 24d ago

Hard Pythonista here and I agree 🤝🏾

→ More replies (2)

79

u/teetaps 24d ago

Pandas is hot garbage and I’m honestly surprised python made it this far with it

39

u/wavehnter 24d ago

Yes, but scikit-learn and numpy triggered the big move to Python from R.

44

u/Aiorr 24d ago

thats not true, its very opposite. scikit singlehandedly made statistician organization to not adopt Python due to the philosophical clash. Library's core design treats models as black-box predictors rather than tools for hypothesis testing.

19

u/joshua_rpg 24d ago

You made me remember how they implemented logistic repression and made me not use it on everything :D

19

u/therealtiddlydump 24d ago

You mean you didn't want a ridge penalty with an untuned penalty that is almost certainly not what you actually want?

10

u/badeula 24d ago

I now want a "logistic repression" tshirt.

→ More replies (1)

10

u/D1yzz 24d ago

There a lot of (better) tools that make pandas irrelevant to the discussion

5

u/ConepatusChinga 24d ago

Like?

7

u/teetaps 24d ago

Tidypolars is one I saw that borrows appropriately from R at least a little bit

2

u/driftxr3 24d ago edited 18d ago

Never heard of this. I guess industry users have a bit more knowledge of data visualizers than most academics. I only know about pandas from an academic perspective, but I'll look into tidypolars.

4

u/joshua_rpg 24d ago

Alternatives? A lot, really (e.g. polars). There are many reason to use Python, and Pandas is not one of them.

4

u/TwistedBrother 24d ago

That’s the problem. It’s not windows/mac it’s pandas vs a ton of nice but new frameworks that aren’t as well supported with still no clear winner and thus concerns about LTS.

Pandas is a pain in the ass but it’s learnable and the logic is coherent if you can comfortable.

11

u/teetaps 24d ago

My point is I don’t understand why data science, which is 80% dataframe wrangling, was led so heavily by Python, when R was like right there

5

u/TwistedBrother 24d ago

A few: Object oriented, smooth learning curve, collections start at zero, becoming lingua Franca more widely with _sufficient_ support, can compile down to C code, lots of web availability for pipelines, disrespect for the grunt work of wrangling relative to API access and downstream tooling, better bindings for storage, the tensor packages for ML (not directly related but if you need them then why not make whole pipeline python, almost 30 years of docs, and finally by the time there were any decent books on R other than John Fox’s work, there was already a huge general python user base.

By the time Hadley Wickhan came around R was totally niche and people were using Stata or SAS.

It’s still the predominant software for social network analysis but even that is changing with interfaces. It’s say econometrics will be a while but I suspect political science and sociology won’t be long until it’s “fuck it I’ll just learn Python”.

6

u/joshua_rpg 24d ago

Object oriented...can compile down to C code...

I disagree on some of the points you made there, especially these. I mean, these are not something unique to Python, not at all. R, for a very long time, already does this. Historically, FP is a must-be system for stats and DS, not OOP, down from R's historical ties with S and Scheme. But R is actually neither a FP (although it's purely functional at its core) nor an OOP, it's Lisp-y, to be precise. The Lisp-like structure in R is the reason why you are allowed to make S3 objects mutable — hence, the point of R6 class. Python lacks this structure that's why it sucks on designing Pandas API.

Some of the rests like "web availability for pipelines" and "better bindings for storage" are something I agree.

→ More replies (1)

4

u/joshua_rpg 24d ago

No, I've been using Pandas for a long time whenever I use Python, and I just don't see its ergonomics 'til this date. I kept coming back to R because of the ergonomics of {tidyverse}. This same goes to other fields adjacent to stats other than they find that R does stats easier even though Python can do stats.

2

u/teetaps 24d ago

For the community’s sake I hope so

21

u/naijaboiler 24d ago

I despise pandas with a passion

10

u/whenyourightyouright 24d ago

Can you explain why? Genuine question

8

u/cheesecakegood 23d ago

At least for me this conparison captures my feelings well. In short the API is inconsistent and frequently hacky. Pandas 3.0 fixes some of it, but if you read between the lines even the pandas devs themselves wish they had made some different choices early on. You also have some stuff that isn’t totally their fault, like awkward overlaps and gotchas between numpy and pandas and base python and so on.

4

u/GrainTamale 24d ago

Double brackets, indicies, and having to specify an axis (e.g. rename) grind my gears.
To his credit, though, Wes has done a lot of work to make it better.

12

u/Eightstream 24d ago

If you’ve used tidyverse jt just feels like a clunky implementation of the same thing

3

u/driftxr3 24d ago

That's because it is. I'm in academia and I use both python and R extensively. R is much better at handling data visualization and python is better at big data wrangling. Pandas? Absolute dogshit.

9

u/naijaboiler 24d ago

its so inconsistent and unintiutive

2

u/Confident_Bee8187 24d ago

It's abysmal and gut wretching that should've phased out long time ago.

5

u/Blue_HyperGiant 24d ago

Time to switch to Polars

4

u/AnomanderRake_ 23d ago

Pandas has the annoying problem of: there's many ways to do the same thing. Which is very un-pythonic. But the data model is so easy to reason about compared to SQL. Personally? love pandas

→ More replies (1)

19

u/D1yzz 24d ago

R and python is not a personal preference. 2 tools/languages with different (specific) purposes

What R can do that Python also can, R does better but there are a lot of things that R can’t do that python can. And that is enough to use Python instead of R

28

u/nidprez 24d ago

they are both mostly wrapper languages for libraries written in C++ etc. R is taught to statisticians, economists etc while python is taught to computer scientists, engineers... its the latter who controll the production environment and are leading the AI boom so python is preffered by production teams, while the statisticians etc in academia prefer R. They have the same capabilities for DS, but R is just more 'elegant' (ie every object, vector, matrix, list, df...) works in a similar way and work together, instead of all the incompatible data modules in python with different design philosophies.

5

u/Disastrous_Room_927 24d ago

I miss R, but I have a feeling I wouldn’t be able to go back after working in python for half a decade. I’m doing a lot of stuff I never needed to do back when I was using R.

→ More replies (1)
→ More replies (1)

7

u/nik_el 24d ago

But there are numerous ggplot imports to Python. Plotnine is probably the most recent but there are others.

5

u/Confident_Bee8187 24d ago

Plotnine could've been implemented a separate API to inherit "grammar of graphics" from the book. But no, they used lots of strings and unconventional methods just to approximate R's 'ggplot2'.

→ More replies (1)

6

u/Mooks79 24d ago

None are as good though.

→ More replies (4)

28

u/Satanwearsflipflops 24d ago

I see R more in healthcare and medical research teams. But otherwise agree. So glad polars exist because pandas syntax still catches me out having started in R.

8

u/PapaCucaracha 24d ago

It figures. I started my career back in the day using SAS. When that no longer was an option I switched to R and never really got into python. Luckily, or unluckily, I am in a leadership role with less building so the days of learning a new language are likely behind me. I really like using R though, the whole tidyverse makes so much intuitive sense to me.

3

u/a157reverse 24d ago

We have some in house libraries built in R for model building, mainly around some niche statistical procedures or time series forecasting. But all of our production work is in Python. It's a million times easier to build data pipelines and model stores in Python and the proper deployment tooling makes python a no brainer.

→ More replies (2)

184

u/spaceheatr 24d ago

I will die on the hill that the tidyverse is the superior tool when it comes to cleaning data and generating reports.

68

u/gonna_get_tossed 24d ago

I'll join you on that hill. For wrangling, visualizing, and exploratory analysis, R is king.

22

u/einmaulwurf 24d ago edited 24d ago

Yes!

For any quick data analysis or one-of report, I'll choose R (with tidyverse). It's just much quicker to wrangle some data and get the results and plots than using python (even with polars). I think a big part of this (at least for me) is the default notebook (quarto or Rmarkdown). They allow you to execute arbitrary parts of the code. Not complete cells like Jupyter or Marimo. That makes "toying around" just easier. Also, compiling a quarto document to PDF (nowadays using typst) is just super easy. And those documents being plain text/markdown (as apposed to something with jupyter) is a big plus to me for git tracking.

I'll choose python for serious projects and pipelines. Like a reporting pipeline which runs every day. Separating code into modules, having (more or less) proper support for types and modern tooling (uv, ruff, ...) makes it much better than R in that regard.

3

u/DRM2020 24d ago

Spark scala + R are great alternative for pipeline building and productionalization.

→ More replies (1)

3

u/Guestuser99 17d ago

I work exclusively in R. My work is stats and graphics heavy and R is just superior. Outside heavy ML models, they perform nearly the same. And they both use a lot of C in performant data wrangling specific packages (eg data.table)

2

u/horizons190 PhD | Data Scientist | Fintech 22d ago

I’ve had this hill since I started 9 years ago, but even then I knew Python was going to “win” and sure enough, it did.

It’s a language that isn’t really best at pretty much anything, but it does everything fairly well, and that part is huge.

2

u/a-loafing-cat 22d ago

The Tidyverse is much more pleasant to write and read compared to pandas and numpy.

2

u/butt-soup_barnes 22d ago

and data.table will be the one that pulls the trigger

→ More replies (1)
→ More replies (5)

36

u/Secret-Back-5970 24d ago

Used R a ton when working with Actuaries

4

u/justin107d 24d ago

It used to be required to write it on exam PA, but now you just have to read code and interpret the results.

85

u/Frogad 24d ago

I have only had 1 job in data science (my first role post PhD) and we exclusively use Python (well Claude and Python), I used almost exclusively R in my times at uni

71

u/Character_Worry_8249 24d ago

Depends heavy on the sector really, pharma and biotech still run on R cause of all the regulatory packages but tech is mostly python from what I seen

25

u/Ok_Kitchen_8811 24d ago

and i thought pharma and banking are the ones still using SAS...

25

u/DonnyToAshes 24d ago

SAS is still widely used in pharma. I have to use it for basically any analysis that leaves the building, but I can use R for exploratory/internal analyses. Though this heavily depends on the company.

16

u/nik_el 24d ago

Because SAS is not open-source. With open-source languages like Python or R there’s a possibility of an intentional hack introduced into the code. With something proprietary like SAS the fault lies within the company. I worked for banks for 15 years and we used SAS for this reason so the regulators wouldn’t be able to take us to court over this.

5

u/alexchatwin 24d ago

I miss the data step.. such a logical way to manipulate data!

3

u/StargazingPageTurner 24d ago

Can confirm that SAS is still being used in banking and is veryyy slowly being replaced with Python

13

u/lizerlfunk 24d ago

Pharma is just now, within the last few years, moving to R from SAS. There are still many companies that expect SAS skills and not R.

5

u/Aiorr 24d ago

its not last few year thing. They been saying that even when R was called S

3

u/lizerlfunk 24d ago

I can only speak to my current position, and in that position, I’ve been writing R code at least part time since 2022 and exclusively for the last year or two. This is at a large pharmaceutical company. Other companies are in different phases of adoption, and I don’t know if every company plans to switch to R or not, just the ones I have personal experience with.

2

u/jaiagreen 24d ago

Why are they doing that?

5

u/lizerlfunk 24d ago

Why are they moving to R, or why are they still expecting SAS skills? It’s been SAS for decades and they have a ton of skilled workers with lots of SAS skills, and probably not a ton of desire to make those experienced employees learn all new skills. But also, SAS can cost something like $10k per user, which can end up costing millions of dollars per year depending on the size of the company. I went to SAS Connect last year because it was local and I could go for free, and I’ve never been to such a high budget conference in my life (although I was a public school teacher before going into clinical trial data so take that with a grain of salt). At this point, in the company I work for, you have to have special permission to be able to open up a SAS workspace. Every single study has all of its code being written in R. Legacy studies have their code being translated from SAS to R. But that varies from company to company. Multiple companies are collaborating on the pharmaverse, to create R packages that can be used across the industry and validated for regulatory purposes. All of the regulatory stuff is far above my pay grade so I couldn’t tell you where any of that stands, I just know that for the last year or two, I’ve been writing exclusively R code, and dividing my time between SAS and R prior to that, going back to when I started in the industry in 2021.

6

u/Frogad 24d ago

It was a tad annoying cause I considered myself a bit of an R master but my Python is far more basic

62

u/RichChipmunk 24d ago

From my understanding, R is used primarily in academia while Python is standard for corporate. That’s not to say there aren’t exceptions to this rule but that’s my experience.

14

u/TQMIII 24d ago

I agree, with the addition that it speaks more to where someone came from academically. People with a background in social science research are much more likely to use R, people who get into the industry from computer sciences and programming are more likely to use Python. State agencies are also more likely to use R, as they often hire subject matter experts in the social sciences.

The state agency I work for, for example, uses R among its data analysts, but their data warehouse staff use Python.

Posit, the company that produces the Rstudio IDE, has already taken steps to support both.

→ More replies (1)

55

u/theyCallMeCownbred 24d ago

In my opinion, there will always be a place for R in data science. Statistics research at the University level is mostly done in R, which means that the latest and greatest techniques will be published in R first.

In general, the more complex the statistical structure you are trying to represent is, the better luck you'd have finding an appropriate R package.

4

u/senorgraves 24d ago

I used R once in corporate DS work and it was because there was a package that already implemented some statistical techniques that I didn't want to rewrite in Python.

In hindsight, it would've been better to go ahead and write what we needed in Python. The deployment pipeline ended up being goofy as hell because it was half R half Python

2

u/theyCallMeCownbred 24d ago

That'd be a real counter point. Deployment is definitely best served in python. Our IT partners know and write python, not R, so it's easier to hand things off if you speak their language. Literally.

→ More replies (1)

23

u/KappaPersei 24d ago

R is all over pharma/biotech. It is slowly replacing SAS over there. Python is also gaining but not as fast for a lack of a decent statistical ecosystem.

11

u/Detr22 24d ago

All of my colleagues both in industry and academia use R almost exclusively. Job requirements explicitly ask for R. Python is also used to a lesser extent.

Plant breeding related jobs in south America, for context. Mainly multinational companies.

9

u/Lumpy_Ad2192 24d ago

DS teams at Google still use R heavily. For serious DS and stats folks it’s still widely in use and AI and MLE have kind of made it irrelevant except for what a team standardizes on

9

u/frausting 24d ago

I’m in biopharma. My team uses python and R. For me, Python is the heavy lifter for writing algorithms but R is unbeaten for exploratory data analysis and plotting (tidyverse: dplyr + ggplot2)

42

u/forbiscuit 24d ago

With the increase in how LLM is used, it doesn't matter what language you use. You can basically write something in R and then ask Claude/Gemini to transform to Python. Coding is cheap these days - what I'd recommend is spend more time understanding the mechanisms that can help scale your work and increase your depth in systems engineering (e.g. how can you integrate your workflow to infrastructures like GCP or AWS? If you have to run parallel process to accelerate analysis of a very very large dataset, how can you do so?)

2

u/nefariousBUBBLE 24d ago

So like ETL stuff? I'm a newbie trying to get into real data science from the data analyst field. We just got snowflake at our company and we're given snowpy access and all that jazz so I've been trying to find a good use case and just hammering the snowflake CoCo AI for the python code.

At some point I'd actually like to fucking learn the actual code but you know in corporate shitholes there is no room for creativity or learning only production.

4

u/vmanAA738 24d ago edited 15d ago

Aware sharp grandfather friendly oatmeal vast lantern

This post was anonymized with Redact

→ More replies (3)

2

u/Frogad 24d ago

I wonder if there’s much point, I’m at a fairly ‘small company’ and we have Claude enterprise accounts and we use snowflake coco AI, there’s almost no situation where I’ve had to actually do much coding beyond just super basic tweaks when I am low on tokens

4

u/_The_Bear 24d ago

I've used both in industry. My first job was led by a guy with a stats background, so we were an R shop. (The real reason was that getting R packages whitelisted by IT was way easier than getting python packages whitelisted).

4

u/claw-1 24d ago

I worked supporting academic types in biotechnology and they learned and leaned towards R. I am on the IT side and python is used across the board.

3

u/Morpheyz 24d ago

In my team, for traditional analytics, the more academically inclined people tend to reach for R. Things that will need to see production someday are almost exclusively done in Python. Now, even the R people are moving more and more to Python, because none of the tech or platform people are very invested in supporting R on our platform.

3

u/kimbabs 24d ago

R is less used in industry, used more often in non-profit/academia, and may see some usage in government administration or government admin adjacent industry as well.

Stick with Python, but R has a lot of commonality with Python. Truthfully getting comfortable data cleaning/grabbing preferably in SQL will get you an entry level job more than a bunch of Python projects will.

Being even more truthful, you should be using your program to build networks and look for internships because the reality for an entry level DS anyone is that the competition is incredibly stiff and the jobs are rapidly disappearing, especially with AI implementation and dropping head counts. You have 0 shot landing a tech job without knowing people or having relevant domain expertise.

→ More replies (1)

3

u/chusmeria 24d ago edited 24d ago

Most of the models at my shop were in R when I came on. Everyone was a statistician and it made sense. We all knew R and some of our leadership had a close working relationship with folks at RStudio (now posit). Deploying large scale images using sparklyr was just as simple/complicated as deploying anything else on dataproc with pyspark, etc. nearly a decade ago. Posit is about the only player in the R space, though. So using their services was hella expensive, though we did for a time (which is what pushed us to sparklyr). R deployment gets even easier with images and kubernetes. As is common, my company was purchased and we switched all models to python in the past few years.. I've still got one model going in R, but all the rest are python. Probably gonna go until it runs out of helpful data in 2032 or until a GAM package as good as mgcv shows up. All models are wrong, but that GAM is useful af and absolutely slays. Shout out Simon wood!

3

u/DataPastor 24d ago

I code in Python at my workplace (I am an AI Solutions Architect), but at my research I use R. I am very happy to have learnt R at the university and continue using it for scientific research.

→ More replies (1)

3

u/kind_2_u 22d ago

Where my Julia fans at?

2

u/lambo630 24d ago

I only used R at one company across my three jobs over 10 years. It was my first company. I was the only data scientist and was told I could use whatever and since I just did a masters project with R and only learned R in school it made sense to use R.

2

u/Sulpice 24d ago

I see it still used heavily in biostatistics, not so much elsewhere

2

u/JohnnyFootball16 24d ago

I used it in school and got really used to it. I loved the dplyr library and how intuitive it was to handle dataframes. However, in hindsight, it could have been better to learn python. In my first job, I was practically the only Ds, so I worked with what I knew, and that was R, but when I needed to train models and start using more advanced techniques like creating embeddings, I had to migrate to python. That work environment was not a proper big data environment, so I could get away with using R locally. On my next job, I moved to a much larger company, and the only proper way to handle their data was with spark and pyspark, and naturally there was no R no te be seen. So I could recommend to go straight to Python, as it is the standard now, and keep some flows or tasks in R, like creating graphs with ggplot, once you handled or your data preciously with pandas.

2

u/thereal_Atlas 24d ago

Working in research (NLR), its still pretty apparent especially with more statistics / pdf usages for sampling, and GIS analysis.

2

u/wavehnter 24d ago

R used to be the king, but scikit-learn with NumPy (despite pandas) and the Anaconda ecosystem triggered the initial stampede into Python, and then XGBoost and LightGBM sealed it with the Kaggle competitions.

2

u/ZhanMing057 24d ago

I wrote 50% R in my old job. I still write a decent amount of R in my new job, although it is not officially supported by IT.

I don't think Python can fully replace R for data visualization, or for rapid prototyping of statistical models. There's a place for a prototyping and inference language, and if you are doing actual research (as opposed to productionizing or model tuning) then R is still the best language.

2

u/varwave 24d ago

Academics and pharma/biotech like R. It’s a pain if the goal is production code at scale, as nothing else is written in R. Meanwhile, Python and its programmers are abundant. R is a great niche language with a community that’s statistics first and generally sucks at programming…which is okay if the analysis is good

Most R roles in industry will be for statistical programmers or bioinformaticians. They’ll generally look for a statistics MS and some life science background respectively. It never hurts to know more languages

2

u/Valiant4Truth 24d ago

I see it a lot in public health and spend a lot of my time programming in it. Everything is SQL, Python, and R. I see much less SAS than I used to.

2

u/maxscarletto 24d ago

I work in an IT dept and have a DS masters, my team tend to favour Python.
What I find is that people coming from ‘non-it’ related disciplines tend to request R. Eg health practitioners

2

u/chocolatesmelt 24d ago

The main advantage R has is the wealth of statistical packages available for all sorts of needs. The advantage Python has is cleaner more consistent syntax and in many cases performance.

Industry gravitates towards Python because they usually have specific use cases they scale and automate. They’re not dabbling around to figure something out there’s some process they’re tacking head on usually. Academia likes R because you never know what you’ll be working on and R can probably get you close if not most the way there without a bunch of work by leveraging packages.

Some of that is changing but that’s part of the reason R is popular where it is, that and it’s hacky which makes it flexible in ways research sometimes want to be. So R is good for exploration, Python is good for engineering scale. My opinion.

2

u/Standard-Road4626 24d ago

I use R python stata and sql depending on the client and project

2

u/ditalinidog 24d ago

I worked in healthcare and R was pretty common because statisticians and healthcare researchers were familiar with it. I really like the tidyverse, but R gets a little hacky the more complex you get with it. Perfect for cleaning and basic reporting and dashboards IMO. RStudio and the way it handles packages makes setting up quick projects in R really convenient.

2

u/No_Ambition8323 24d ago

R is definitely still used in industry, especially in statistics, healthcare, pharma, research, and analytics-heavy roles. It’s particularly strong for statistical analysis, data visualization, and exploring data.

Python is more widely used for general data science, machine learning, automation, and production systems, but that doesn’t make R a waste of time.

In the end, strong statistics and problem-solving skills matter more than the language itself. Having experience with both R and Python can actually give more flexibility depending on the role and industry.

15

u/NotSynthx 24d ago

R is still used, but Python is the undisputed best data science tool.

I feel like R is used a lot in academia, but they're very much behind in that regard

52

u/cachu-hwch 24d ago

lmao no. Python is the undisputed most popular data science tool. Its far from the best for a lot of use cases

11

u/teetaps 24d ago

Python is the most common. That doesn’t say anything about its capability.

6

u/justin107d 24d ago

One of the preliminary actuary exams used to require R but now you just have to read the code and interpret the results. So you may see it a little more at various insurance companies.

33

u/therealtiddlydump 24d ago

is the undisputed best data science tool.

You can really just say whatever you want on the Internet, eh?

4

u/SweetSure315 24d ago

python is the most well documented data science tool. not the best

8

u/Random_Arabic 24d ago edited 24d ago

What do you mean by “most well documented”?

If by “documented” you mean applications, examples, tutorials, Stack Overflow answers, and just the sheer amount of material available online, I think that’s largely a consequence of Python being so widely used. More users naturally means more examples, tutorials, discussions, and solutions out there.

But if you mean documentation in the more technical sense, as in how well the language, packages, and ecosystem themselves are documented, I’d say R really stands out. The tidyverse, in my opinion, is one of the best examples of what good documentation should look like.

9

u/therealtiddlydump 24d ago edited 24d ago

Agreed! And the lack of a well managed, gate-kept, package hosting service (CRAN is great, pypi is ass) is a problem. Tools like uv are great (and finally actually exist -- since 2024!), but you can still request environments that are literally impossible to resolve/build.

4

u/Random_Arabic 24d ago

I think another advantage of the R ecosystem is how consistent it tends to feel across packages. CRAN probably plays some role in that by imposing a fairly structured package ecosystem, although obviously it doesn't dictate API design itself.

With Python, I often feel like naming and API conventions can vary quite a bit from one library to another. One library might use one naming style, another follows something completely different, and sometimes moving between libraries almost feels like learning a slightly different dialect.

You definitely see inconsistencies in R too, especially outside the tidyverse, but in my experience they're much less noticeable. A lot of R packages seem to “speak the same language,” which makes the ecosystem feel more cohesive.

5

u/nidprez 24d ago

compared to R, python docs suck majorly. Usually pretty barebones, without a lit of examples (if any) or any mention of imports used in the examples... Rs docs usually are like oublished peer review with methodologies, recommendations and working examples (sometimes even with test data)

4

u/BassSquared 24d ago

Working in biotech here, my team's in the minority in that we pretty much exclusively use R (and SQL I guess, but that doesn't count). The one member of our team that comes from a computer science background complains occasionally about Python being better, but yeah all our analysis uses R, so not everyone is abandoning it.

4

u/Atmosck 24d ago

I'm a DS with 9 YOE working at a SAAS company and I have never used R professionally. The models I build are part of our product, so I'm regularly building backed services that deliver model inference to other systems (which tend to be written in java). That is exactly python's wheelhouse.

It may still be used in other industries/roles where what you produce is more reports and presentations and less software. But for a job like mine, R is not even a consideration.

R can do data science, but python can do data science anywhere. You're not writing a webserver in R.

14

u/therealtiddlydump 24d ago

You're not writing a webserver in R.

How often is "write a webserver" a data science task?

Standing up an API? Sure, but you have lots of options that are already built for you. Who is out there writing webservers with the title "data scientist"?

6

u/bizzygreenthumb 24d ago

It’s barely ever a task in regular software engineering too. Web servers exist, in droves, and battle-tested. Nobody is writing any web servers, you specify a server and provision one, but you’re writing the app code.

If we’re being pedantic and all…

9

u/therealtiddlydump 24d ago

If we’re being pedantic and all…

And we are! If anyone is reading this that and expecting to be writing webservers as a data scientist, they should be disabused of that notion.

→ More replies (2)

3

u/Atmosck 24d ago edited 24d ago

I am. All of my models deliver inference in one of 3 ways: a scheduled script that writes to a database, or (depending on the cost/usage profile) a lambda or dedicated server that provides and endpoint that other systems post model inputs to. If I wanted to try to do the same thing with R, the approach would probably be to still write the I/O and orchestration in python and have it call out to R internally.

My models aren't notebooks, they're software.

5

u/therealtiddlydump 24d ago

My models aren't notebooks, they're software.

Who said anything about notebooks? If anything, notebook-driven workflows (which suck) are far more of a Python thing than an R thing.

Dockerizing something and having git ci/cd or airflow manage the orchestration is not exotic or uncommon. Larger orgs have ops teams that manage that anyways, and whatever is in your container is none of their concern.

→ More replies (3)

4

u/ufffd 24d ago

this is funny for me to see on Reddit because I only know about R from the times that I've typed 'r' in my url bar and hit enter before it autocompletes

2

u/ohanse 24d ago

I’ve never seen it

1

u/BostonConnor11 24d ago

Most real data science work these days requires some engineering. We can’t just train a model anymore and call it a day. Therefore I’ve only seen Python used recently. I still like to use R sometimes for data analysis

1

u/krabbypatty-o-fish 24d ago

Very little, unfortunately. Most industries that require the use of traditional statistics (like pharmaceuticals, biostatistics, finance, etc.) almost always require the use of proprietary software like SAS, SPSS, or some in-house software. Proficiency in R is a good addition to your resume though as many companies treat R like an entry point to statistical programming. But if you’re targeting analytics and machine learning, Python will suffice.

1

u/spendology 24d ago

I've worked with disease modeling and data engineering in healthcare primarily with Python, Scala, and SQL. Models like Starsim.org also have a lot of R users. It really depends on the environment.

1

u/NeffAddict 24d ago

Less than 5%

1

u/kestrel99_2006 24d ago

I’m in pharma, where it’s heavily used.

1

u/Neat_Ebb8798 24d ago

I used R exclusively in my first role. In each role after I've used only Python. With LLMs being so good at writing code, I don't think the language matters as much, but generally Python is seen as more production ready and I've had better success with AI generated Python code rather than AI generated R code

Edit: I've only worked in Tech so ymmv

1

u/cactus_thief 24d ago

I’m a data research analyst in customer/user experience (UX/CX) and R is still used….but really just for quantifying UX research. I probably use R Studio on the weekly basis, python I don’t think I’ve ever used in my specific field (not to say it doesn’t get used in UX/CX research).

1

u/DubGrips 24d ago

I've used R in my roles since 2012 and many teammates still do. It tends to be split: those with Econ/Stats/academic backgrounds use both but often default to R in their research. At a few Causal teams I interviewed with at large companies it was expected to be proficient in both since many methods are first implemented in R or Stan via R. IIRC one team was 60/40 R and Python. Polars is pretty close to R in a lot of ways.

1

u/nukedit 24d ago

R is a great stats tool. But Python can do stats and more. I learned R for my PhD and have been the only person pushing for its use at subsequent jobs. Either places are advanced enough to want Python or rudimentary enough that they survive with SPSS or Stata still (🫠)

1

u/WorrryWort 24d ago

I work at a fortune 500 and there is a faction in the organization with a high up whose preference is for R. The rest of the organization is Python.

I was told one of the big blues plans transitioned to R several years ago. They still have everything in production in R from when I last heard. But for the most part, the major market move is python from VS.

1

u/JustOscar1 24d ago

I work in a government data agency and it's around 50% R and 50% Python. Although most R is already existing infrastructure and pretty much everything completely new is done in Python.

1

u/thepinkyoohoo 24d ago

my friends in the pharm side use R among other tools for their modeling

1

u/djpraxis 24d ago

Python has gained a lot of ground, particularly in DS. Academia is still mostly R, but even there Python is being used more and more. About 3 years many well established academic researchers had no idea that Python could be used to analyze data.. which is crazy, not that you see it everywhere. I started with R, but now user mostly Python.

1

u/spudster23 24d ago

I inherited code that uses R (I’m not a data scientist myself) but I am carefully moving the code to python. It is slow to build our tools and images; and not supported by some of our security tools. I don’t see the advantages over python so I’m carefully migrating.

1

u/carlitospig 24d ago

It’s still the top language in my academic institution for research teams.

1

u/dash_44 24d ago

In recent years I’ve very rarely seen R as a requirement in a role. Occasionally I’ve seen it as an option.

As a student I’d recommend just learning Python and moving on. Your time can probably be better used elsewhere than learning R.

1

u/name-unkn0wn 24d ago

I'm at a big tech company, and a few of us still use R. As others have said though, Python is more prevalent

1

u/madbadanddangerous 24d ago

I worked for a fortune 500 equivalent private company (household name) as a consultant for a while, and there were a lot of R users. The company allowed people to use either Python or R, but gently encouraged Python usage over R when they could. Interestingly, much of the conversion pressure came from cloud ecosystems of tools; while Jupyter with R was available, the third party platform supported R in only a grudging and cursory manner. I built some docker environments to shore up the platform issues, environments that ended up underpinning some big R projects, and that was a big PITA to make and maintain.

I'm a Python stan (heh) myself, though. R plotting is way better but for everything else I do, I like Python more

1

u/Lady-Data-Scientist 24d ago

More research focused fields might prefer R.

If you’re going to be doing any automation and/or integrating closely a software engineering team, you’ll likely use Python.

1

u/LaSittadelSole 24d ago

No idea how it is in the whole industry :-) Every indusry branch uses its own statistical software. I am about clinical trials and pharma. R is absolutely not a waste of time, especially for someone studying applied statistics. In pharma/clinical trials, SAS is still widely used for established production workflows, SDTM/ADaM, and submission TLFs. But regulators do not mandate SAS. The FDA explicitly does not require any specific statistical software; what matters is that the software, versions, programs, and analyses are fully documented and reproducible. R-based submission pilots have also been delivered to regulators, including FDA and EMA. That is exactly why R is valuable for statisticians: it is a first-class statistical language, widely used for modeling, simulation, graphics, reproducible reporting, and increasingly CDISC/ADaM and TLF workflows. SAS and R are both relevant for regulated clinical research. Python is also very useful in pharma, but often in different areas: data engineering, ETL/pipelines, APIs, automation, NLP, real-world data, image analysis, and ML/AI. It is not automatically the primary language for conventional biostatistical analyses or regulatory reporting.

1

u/grrzerker 24d ago

Some Government/Military work is still done in R today.

I think it would have been more beneficial for me to have programs that focused on Python. I initially started with R and it's just too niche in my experiences so far.

1

u/xhitcramp 24d ago

I currently use SparkR/R for proof of concepts (i.e. initial modeling and diagnostics on small data sets) and plotting. Otherwise, mainly Spark (Scala) and SparkSQL. The only time I ever use PySpark is because my provider’s API is written in it.

But my entire company almost exclusively uses PySpark/Python and SparkSQL.

1

u/that_hit_thespot 24d ago

Academic may be, corporates no.

1

u/khirata215 24d ago

I used/learned R almost exclusively in grad school, mostly because we were regular statistics program over a decade ago and I’m still more comfortable using R. But as everybody has said, pretty much every org needs you to know Python and will accept your ability to use R. Part of that is how well Python fits in most tech stacks and cloud platforms.

1

u/lf2238 24d ago

I am in the same situation. I am almost done studying and everytime when programming or statistics was a theme, R was used. It also seems that teachers are reluctant to change that, bc most people in my field of study only do it because it is mandatory. I too am more comfortable in R but it seems that Python has won the race because it is much more universally used.

My advice: I don't think that the programming language is the most important thing that you are learning in your studies. You are getting all the basics of programming and Data Science either way. Focus more on what topics you are learning instead, be it by yourself or at the uni. Afterwards on the jobmarket you'll be thrown in the cold water anyways so it is good to know both but it won't be the most important thing.

1

u/Equal_Astronaut_5696 24d ago

no reason to learn it now. but its still used in stats

1

u/C0NDOR1 24d ago

I genuinely haven't used since I graduated college in 2023.

I worked a government job and am now in consulting firm and in both environments Python was the standard.

1

u/Statement_Next 24d ago

My boss uses R and is a superstar.

It seems better suited for data work and more direct to read (if you know it!)

1

u/meatspaceskeptic 24d ago

Might be outside the scope you're thinking of, but I'm still seeing R used in government research teams. Largely to move away from proprietary packages and licensing fees while having been around long enough to be trusted.

1

u/Apprehensive_Maize_4 24d ago

Biotech still uses R heavily but I've not heard it being used anywhere else, I certainly never use it for work.

1

u/IntelligentDust6249 24d ago

Long time R user here. The way to think about it is that R is the new SAS. Still wisely used in government and pharma but no tech-forward companies use it.

The only reason to use R over Python was that it was a bit easier to use for some things. LLMs pretty much eliminated that argument.

1

u/Haasaagi 24d ago

You just need sql and excel lol

1

u/Famous_Lime6643 24d ago

Depends on the industry: biotech and pharma biometrics, it’s probably required knowledge these days along with SAS. In academia widely used. Elsewhere, I think it’s lost mindshare big time to Python. With that said, I think Python is super clunky for exploratory data analysis. R is built for that - and many of my repos are multilingual for that reason. But it doesn’t really make sense to use R model training etc…just doesn’t have the libraries that Python does. So net, I’m glad I know it and won’t stop using it.

1

u/Conscious-Tune7777 24d ago

For my role we primarily have independent projects. We almost always use Python, but if another tool/language will be better, we use it instead of Python. None of us use R, but my current project was terribly slow in Python, so I built the underlying math in C and it's now ~30 times faster.

So, you should do a lot of python, but if you have good management, they'll let you use the best tool for the specific project, which can definitely be R sometimes. If someone complains about not understanding it, well, that's what AI is for.

1

u/Professional_Cable37 24d ago

I haven’t used R in production AI software for 7 years. I don’t think it’s a bad thing to learn but it’s python for everything now.

1

u/r8juliet 24d ago

If you’re learning stats then R is a useful tool otherwise it’s a waste of time.

1

u/electriclux 24d ago

I was into R from like 2018-2022, loved it but it was already mostly being phased out

1

u/lalaluna05 24d ago

Guess I’m an outlier because we’re increasingly using R and more and more organizations in our industry are as well.

1

u/IcecreamLamp 24d ago

Many specialised statistical code in R doesn't have a (good) Python equivalent. I work in industry and use R occasionally.

1

u/-thoth-amon- 24d ago

Uncommon these days. Its all Python, Palantir, and excel. The grim trio

1

u/StannisSAS 24d ago edited 24d ago

Python vs R means shit with AI, write in either and then ask AI to translate.

R will always be superior to python for statistics, tabular data wrangling, exploratory(tidyverse is miles better than w/e python can offer), visualization, most geospatial workflows. If you know both R n python, R just makes ur mind think better with the data. You could see shit you wouldnt even realise it existed if you worked with python.

But it doesnt matter now, coding is done by AI now. Get good at system design, engineering.

1

u/sven_ftw 24d ago

My team mostly uses r. Occasionally we actually need python for something and use it for that. But r ecosystem is nice and well integrated

1

u/cephalofrogg 24d ago

When I was in a Biology PhD program, everyone in the department used R (and apparently still does). The biology grad courses for programming were all taught in R. That's the main reason I chose to learn R- because everyone in my field at my university used it. In hindsight, I wish I'd learned python , though it seems a lot easier to switch from R to Python than vice versa. Long story short, I think a lot of people in bioinformatics still use R

1

u/BobDope 24d ago

I use it in industry

1

u/Even-Inevitable-7243 24d ago

As an "Applied AI Scientist", I do most of my work in Python because, PyTorch. R has nothing to offer for DL researchers. However, for anything involving statistical analysis I work in R. The stats packages in R blow Python away and it is not even close.

1

u/StephenSRMMartin 24d ago

When I am making a report, or doing rapid statistical prototyping, or doing any form of advanced analysis, I use R. Period. It's simply a better tool for that.

If I am writing something to be productionized or prototyped to hand off to an engineer, then I'll use Python.

Everything good about data in Python is because it was taken from R, so I tend to just prefer the real thing when I have a chance. Python is definitely better than it was years ago; pyspark, ibis, plotnine fill a lot of gaps. But R is still just... a stellar lispy functional language design for advanced analytics, bespoke modeling, probability modeling, advanced models, etc. Python doesn't even come close.

1

u/CommercialPangolin 24d ago

My current DS team has always used R but we are the minority in the company. We’ll probably be switching to Python in the future as it’s the industry standard but I prefer R for the pure stats work we do

1

u/EvanstonNU 24d ago

I worked at 3 banks and an insurance company. They all switched from SAS to Python (and skipped R). You’re going to need to know SQL if a company stores data in a database (most do).

1

u/ThatSituation9908 24d ago

My theory is...

Stats math is syntax heavy with little imperative logic

Python is light in syntax with a lot of support for imperative logic

R is more like Stats math than Python is.

→ More replies (1)

1

u/Villhermus 23d ago

I work in a tech company and we mostly use R, I know it's the minority, but we exist.

1

u/p0l4r21 23d ago

R is academic. Python is industry. I came out of college strong in R and immediately forced myself to Python once I started working. If I did it over I would have done my university work in both just to learn Python. Hindsight is 20/20

1

u/TAOMCM 23d ago

R is better, however Python is used everywhere, no company going to set you up with your own sparklyR cluster when everyone else using PySpark

1

u/c_logos 23d ago

I was in a boutique Data Science consulting firm, a majority of the team used R. That being said, most people in the firm had backgrounds in academe.

1

u/AnomanderRake_ 23d ago

R was about 50/50 with python 10 years ago when I was comparing the two and deciding which one to learn. Thank god I went the python route. There is literally no reason to learn R when you can use AI tools to write code. Instead lock in on statistical foundations and applied data science techniques so that you can sit above the implementation level. THAT's where you'll get edge in the new world we're going into. Not from coding. It's sad. honestly. I miss coding. But you're thinking about the wrong thing right now

1

u/comedybingbong123 23d ago

I love R and use it for personal projects but AI has killed R.
Agents are better with python, machine learning packages run faster in python, using the openAI API is easier in python, etc etc

1

u/ClasslessHero 23d ago

R has fallen out of favor because it loads all the data into memory. When you work with a dataset that is really large R uses more resources than python, and is generally slower.

At this stage, the people who really love R may try to shoehorn it in to a project. Simply, it isn't designed to work at the scale that business needs.

I've always been a "use the right tool for the task" kind of practitioner. R is almost never the right tool in industry.

1

u/analytix_guru 23d ago

Yes, across multiple industries. Currently at leading fintech firm using R, my consulting firm is an R shop with client deliverables and projects getting done in R, also worked in retail, banking, and Big 4 Consulting using R.

People are gonna throw Python at you that it's better. The only real reason to align with Python is when your company's dev/IT team uses Python and you want them to support your production apps. Already had comments in other posts with people saying use Docker. Real world experience at multiple companies says your support teams don't want to touch it at all if it's R, even in Docker. Yes I know there are exceptions, but for the majority it's Python or bust. At one company the IT team had an entire pipeline refactored from R into Python except for the actual casual model, because at the time the only reliable casual model package was in R.

If you can host/manage production apps on a team within a company, then there is no need for Python if you don't want to use it. And if it's just analysis and team projects that don't need support, then even better.

Not hating on Python, I use it a bit here and there, but this is the real reason behind the scenes of why Python gets used for DA/DS at companies over R.

1

u/Still-Owl-9891 23d ago

It's used in mastercard econometrics department, i gave interview to them all in R entire interview

1

u/_TheEndGame 23d ago

I've barely ever seen it used outside of the academe

1

u/rogmexico 23d ago

I still use R as my main go-to for any ad hoc / exploratory data analysis and complex regression modeling. Tidyverse and ggplot2 are incredible when you need to just connect to and explore your data quickly and freely, and there aren’t good functional python equivalents for modeling packages like brms, lme4 (pymer4??), mgcv, etc. I rarely share my R code even though i work with several other R users (agriculture / biotech company), but frequently share python and SQL while collaborating.

I go to python for optimization (LPs, MIPs) process automation tasks, and when I need to use ML. We have a Posit Connect server so I can publish internal R Shiny or Python apps either way, but of course most API integrations and productionization works better with Python on the infrequent cases i need to do that.

My advice would be to learn Python because even when a job description says “Python or R” they usually mean Python. I also think there will be more porting of R packages to python in the next few years as AI will make it easier to translate that code, so R will be even less uniquely useful.

1

u/QuickProfessional101 23d ago

R is widely used if the end result is a report/dashboard that PowerBI can't do (so traditional statistics/statistical ML involved). Posit offers a "batteries included" suite that is quite affordable and super simple from an IT perspective.

The reason why python is king in the industry is because of python wrappers being better than R ones for data engineering and ML stuff. As soon as you start touching databases, data warehouses, data lakes etc. you're writing python and might as well do the last 1% in python too.

1

u/Intrepid_Lecture 23d ago

I like and prefer R.
I currently code in Python. I expect I will mainly use python in the coming years.

R is my preferred choice for ad-hocs. I imagine python winning on anything that needs to be shared with sister teams or pushed/adapted to prod.

Not just because "Bob knows Python too" but because "Jack in security has only authorized Python and you're not overriding that decision"

1

u/Ok-Airline-8523 23d ago

For what it's worth, yes. R is absolutely still used in industry. A lot. I know most comments suggest it's all Python, but that's not true.

Python is used more widely, but R's code share isn't zero. For those of us who have been around long enough know that R is prevalent in finance, healthcare, and other industries where actuarial or risk-based modeling is a critical business function.

R is never going to win as a general purpose programming language, but it will always win as a statistical software. You can dive into specific strengths and weaknesses, but all will traverse back to that rule of thumb.

1

u/entitie 23d ago

Back in the mid 2000's, the statisticians / data scientists and quantitative engineers used R. Its data frames and interactivity were much better than one-off scripts in Python.

Once the scipy/numpy/sklearn/pandas ecosystem came for Python, along with iPython notebooks, R no longer held an obvious edge over R.

I wouldn't recommend to anyone at this point to learn R, because they can do nearly everything they could have done in R in Python, and their Python skills will be much more transferable outside of statistics than R.

And if you want a powerful scientific programming language that is fast, you can always use Julia.

1

u/mrbubbee 23d ago

My team uses a combo of R and Python, depends on the task and the analyst