A2-Ai

CLI · Package management

rv

Open source · MIT

A Rust-based CLI for declarative R package management that resolves the full dependency tree of the configuration file’s declared dependencies before installation and records exactly how each package was installed, so environments across machines are reproducible over time.

Overview

What is rv?

rv is an R package manager, written in Rust, to help users install and manage R packages in a declarative, reproducible, and fast way.

Similar to tools like uv, Cargo, and npm, rv uses a configuration and lock file to allow the flexibility to determine how, from where, and what is installed, while maintaining reproducibility across systems and users.

Why rv?

renv and many of the other R package installation tools in the ecosystem have flaws, many of which are caused by packages being installed iteratively, which leads to the development of rv.

rv gives users the power to declare a desired global state and allow the tool to determine how to best reach that state, while locking the how and from where that package was installed. Meanwhile, other tools in the ecosystem, like install.packages() and pak::pkg_install(), provide you with a mechanism to reach towards the desired state, but in an iterative, non-reproducible, and potentially unstable way.

With rv you can:

  • Install a cohesive set of packages, ensuring each is compatible with the others in the project.
  • Specify options for individual packages, including which repository they must be sourced from, whether to install the source or binary version, whether to install the Suggested packages, and many more.
  • Understand how your project’s package environment will change before any installations are performed.

And, we did it over 25x faster than the other tools too.

Differences between renv and rv?

renv utilizes the traditional R package installation pattern of iteratively installing packages, and then retroactively “snapshotting” the current state of the project library to generate the lockfile. This leads to two common issues that make a project not fully reproducible:

  • The iterative installation leads to incompatible versions of packages being installed
  • Information about how a package was installed is lost by the time a snapshot occurs

rv solves these issues by resolving the full dependency tree ahead of time, avoiding the risk of incompatible package versions. Additionally, by locking at the time of installation, all of the information regarding the installation is captured, instead of only after it is installed.

In summary, rv’s declarative design ensures users are provided with a working, fully reproducible environment in a way that’s approachable enough for a new R user, but complex enough to fit an advanced developer’s needs.

Source github.com/A2-ai/rv
Type CLI
Category Package management
License MIT