Readit News logoReadit News
arbutus8 commented on Show HN: Rv, a Package Manager for R   github.com/A2-ai/rv... · Posted by u/Keats
j_bum · 3 months ago
Looks interesting, I’m excited to give it a try.

Is there any plan to have it create a manifest (like renv.lock) that can be used directly with the posit publishing system?

arbutus8 · 3 months ago
Yes, that's a feature we are considering adding
arbutus8 commented on Show HN: Rv, a Package Manager for R   github.com/A2-ai/rv... · Posted by u/Keats
condwanaland · 3 months ago
Very cool! Are you planning for there to be a corresponding R package that exposes the high level commands? The popularity of the usethis package really showed the power of keeping people within the R interpreter rather than going back and forth with the terminal. This is so important for a language like R that has so many users without much CS training
arbutus8 · 3 months ago
Yes! Absolutely in the plans to have a corresponding R package. In the meantime, we've created a `.rv` R environment within rv projects that allow users to call things like `.rv$sync()` and `.rv$add("pkg")` from the console. Our internal user bases is primarily not CS based and have found these functions extremely helpful
arbutus8 commented on Show HN: Rv, a Package Manager for R   github.com/A2-ai/rv... · Posted by u/Keats
scrappyjoe · 3 months ago
Doesn’t renv do that? What need does renv not meet for you?
arbutus8 · 3 months ago
Ultimately, you're right that `rv` and `renv` get you to the same spot, both create reproducible, isolated projects. `renv` has a few issues that we often hit that lead to `rv`.

`renv` is an iterative process of installing some packages, then snapshotting your project state, and then trying to reproduce. The time between the installation and snapshot can often lose information (think `install.packages("my_pkg", repos = "https://my-repo.com")`, your repo source is lost by time the snapshot occurs). You can also install incompatible versions over-time.

rv solves both of these problems because it will lock the source at the time of installation. Additionally, because it is declarative, we are able to resolve the full dependency tree before installing packages to ensure everything will be compatible.

While I am a big proponent of using rv, if renv fits your needs, then switching to rv may not be worth it. For our organization, we did have multiple issues with renv, so created a replacement for it that we hope others in the community will find useful to address their needs.

arbutus8 commented on Show HN: Rv, a Package Manager for R   github.com/A2-ai/rv... · Posted by u/Keats
_Wintermute · 3 months ago
My biggest issue with R package management is version pinning. If I specify an older version of a package, R will fetch the latest versions of all its dependencies, regardless if they're compatible or not, which leads to manually chasing down and re-installing specific versions of dependencies and sub-dependencies one-by-one.

Microsoft's CRAN time machine helped solved this, but I think they've recently shut it down and I don't really trust Posit to not have a version behind a paywall.

arbutus8 · 3 months ago
You're hitting one of my (and many people's) main issue with the R package distribution system. In CRAN, only one package version is available at a time, which makes things like version pinning quite difficult. Now the benefit of that is that CRAN guarantees all packages will work together at any moment in time, but then trying to reach back into the Archive breaks that guarantee.

What the CRAN time machine (and now Posit Package Manager) does is take that compatibility guarantee, and freeze it so you have access to all the same, compatible, packages at any moment in time.

While I personally do use PPM fairly extensively, I do understand the paywall concern for long-term reproducibility so `rv` can help you here, with a bit of manual massaging. I'd recommend setting the repositories section of the config file to be a snapshot date in PPM that contains the package version(s) you're interested in and then installing using that repository (taking the benefit of that CRAN guarantee), then in both the config file and `rv.lock`, replace all the references to the PPM repo with your preferred CRAN mirror. This will allow you to resolve to compatible package versions, but then for your POSIT concern, will still be able to reproduce using the CRAN archive.

u/arbutus8

KarmaCake day5May 16, 2025View Original