Not sure how any of this is really relevant here. This is a general R gripe.
Not sure how any of this is really relevant here. This is a general R gripe.
Explain what you mean by this. It’s a big claim without any supporting evidence.
The tidyverse is absolutely full of breaking changes. Two big ones off of the top of my head: dropping underscore functions like mutate_, and turning common column names into new function names. So in different organizations you might see two patterns:
* Monolith - everyone uses a set of R packages from 2017 or whatever (frozen in time either through MRAN or Nexus)
* Wild dockerization - one team’s internal tooling is incompatible with the other team’s, so working across teams you gotta rely on Docker a lot
Why? Cause there’s not really a good way to pin versions besides shrinkwrapping, at least in my experience. We tried Drake, but Drake itself had so many breaking changes that it gained a really bad rep (from what I hear from colleagues, haven’t used it myself). Tried renv but it was destroying some of our analyst’s setups (like, you just get a bomb icon in Rstudio). Didn’t troubleshoot it too much, kinda just gave up.
I don’t like forcing a specific vintage of packages, but I like everything else less.
The idea behind a native R solution is that it is far less likely to be deprecated.
By contrast, R has the occasional but rare installation issue, and almost all the common ones are solvable in a few minutes with a re-install.
I think for large software projects where dependencies could be an issue, especially long term, R might not be the best choice.. for now anyway.
I feel some of your pain on the tidyverse front, but for that reason I stick mostly with fairly common functions and avoid exotic new ones. Even if I do venture into new ones, I comment them so I know precisely what's going on so in the event of a refactor a few years' down the track I'll be fairly safe. With R there's usually 10 ways to do the same thing, so you're never completely stuck, you'll just get an error which typically has some sensible way to handle.
To spin a positive light on the deprecations, most are replaced with something nicer, so although you have the pain of updating old code, it forces you to be aware of the new approach, which is a silver lining of sorts.
Which further emphasizes the idea of: R might not be the right tool for production processes. I used to fight that concept, but in the past year or so I’ve come to embrace it.
devtools I guess is a solution (write some code to iterate over package requirements), but let me ask you this - how do you protect against breaking changes in devtools?
I have yet to encounter something more reliable than MRAN snapshots https://mran.microsoft.com/documents/rro/reproducibility
Many popular packages like data.table rarely break after years of version upgrades. But relying on that in any kind of programming language is asking for trouble...
We're using renv since about a year at our workplace and haven't had any major issues occur. Maybe try packrat? Or try conda with R. Otherwise using docker should eliminate most reproducibility issues
Let’s say two competent analysts wrote some code 5 years ago and you need to reproduce it today, one in R and the other in Python. The Python code probably includes a `pip freeze` or some equivalent, but the author of the R code had no equivalent. There’s no good agreed upon solution. And I don’t think I could reasonably fault that R analyst.
Packrat seems to be falling out of favor, I should read more about conda with R.
(The way I’d solve this problem in R is with an MRAN snapshot from 5 years back in a Docker image, but that’s basically accepting I won’t be able to integrate it with more recently written R)