Discussion about this post

User's avatar
Trevor Freeman's avatar

I think R+tidyverse is marginally nicer for basic data cleaning and plotting. Although for me Polars+Plotnine has made the gap pretty insignificant, and I have well over 5 years experience with R+tidyverse over Polars+Plotnine, so it's hard to directly compare.

The problem with R is that doing anything besides chaining together a bunch of tidyverse functions in a notebook absolutely sucks. Every time I go to write a little module that I want to be reusable and portable and tested and that handles errors I want to pull my hair out. Little things like implementing a command line interface for a script or two are so much nicer in Python that I think it's well worth giving up the marginal benefits of the tidyverse. Don't even get me started on basic utilities like logging, implementing custom classes, built-in support for modules and virtual environments, native assertions for zero effort sanity checks in the code, not having the entire developer experience revolve around RStudio/Positron, and so many more.

I don't want to come down too hard on R. I still use it almost daily, and as a language for statistical analysis I think it's completely unparalleled. But as someone who also has to frequently write "real software" to get some data science related parts of my job done my chest gets tight when I realize a core part of what I need to write has to be done in R.

Expand full comment
gmdbioinformatics's avatar

I agree with the general sentiment - I also come from an R background, and struggled to move to python. I have a draft for a similar article somewhere, that I never published.

However, for machine learning, python is just better supported. I do a lot of Kaggle competitions, and it is very rare to see R notebooks there. I've tried h2o, tidymodels, and similar libraries, but they are so behind the Python counterparts. And they are also so much slower, and memory consuming, as R really struggles with big datasets.

Expand full comment
30 more comments...

No posts