rv A2-Ai
winget install --id=A2-Ai.rv -e
A new way to manage and install your R packages in a reproducible, fast, and declarative way.
rv is a tool designed to simplify and streamline the management of R packages in a reproducible, fast, and declarative manner. It allows users to specify dependencies, repositories, and customizations through a configuration file, enabling precise control over package installations and library synchronization.
Key Features:
- Declarative configuration files that define project-specific settings, including R version, repositories, and dependencies.
- The
rv plan
command provides a preview of actions before execution, ensuring transparency and minimizing errors. - The
rv sync
command synchronizes the library with the specified configuration, installing required packages and updating lock files for reproducibility. - Customizable package installations, allowing users to specify options such as whether to install suggested dependencies.
- Support for multiple repositories, enabling flexible access to R packages.
Audience & Benefit:
Ideal for data scientists, researchers, and developers who work with R and require consistent, reproducible environments. rv helps users save time by automating package management, reducing manual configuration errors, and ensuring that projects can be easily replicated across different machines or team members. It is particularly useful for teams collaborating on complex projects with numerous dependencies.
rv can be installed via winget, making it easy to integrate into existing workflows and development environments.
README
rv
rv
is a new way to manage and install your R packages in a reproducible, fast, and declarative way.
> [!WARNING]
> rv
is still in development and may not be fully documented. For additional information, issues, or feature requests, please create an issue or contact us directly.
How it works
rv
has several top level commands to provide the user with as much flexibility as possible. The two primary commands are:
rv plan # detail what will occur if sync is run
rv sync # synchronize the library, config file, and lock file
The subsequent actions of these commands are controlled by a configuration file that specifies a desired project state by specifying the R version, repositories, and dependencies the project uses. Additionally, specific package and repository level customizations can be specified.
For example, a simple configuration file:
[project]
name = "my first rv project"
r_version = "4.4"
# any repositories, order matters
repositories = [
{ alias = "PPM", url = "https://packagemanager.posit.co/cran/latest" },
]
# top level packages to install
dependencies = [
"dplyr",
{ name = "ggplot2", install_suggestions = true}
]
Running rv sync
will synchronize the library, lock file, and configuration file by installing dplyr
, ggplot2
, any dependencies those packages require, and the suggested packages for ggplot2
. Running rv plan
will give you a preview of what rv sync
will do.
Additional example projects with more configurations can be found in the example_projects directory of this repository.
Installation
See the installation documentation for information on how to install rv
.
Usage
See the usage documentation for information on how to use rv
and how to configure it with
the rproject.toml
file.
Contributing
Getting started
To get started with the development of rv
, you'll need:
After installing Rust, you can build the project by running:
just run
// or
cargo run --features=cli --release -- ...
e.g. just run sync
or just run add --dry-run
.
If you'd like to install the current version of the project as a binary, you can run:
just install
// or
cargo install --path . --features cli
Unit testing
Run the unit tests with:
just test
// or
cargo test --features=cli
Snapshot testing
Snapshots require R version 4.4.x.