Skip to content

ruv is a lightweight R version manager for seamless installation, management, and switching between multiple R versions on your system.

License

Notifications You must be signed in to change notification settings

RyoNakagami/ruv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruv

A fast R version and package manager, written in Rust. Inspired by uv.

Status: Early development (v0.1.0)

Features

  • R Version Management: Install and switch between multiple R versions
  • Virtual Environments: Project-isolated package libraries (like Python's venv)
  • Lock Files: Reproducible environments with ruv.lock
  • Fast Installation: Uses pak for parallel package downloads

Quick Start

Install R and Create a Project

# Install R 4.3.0
ruv r install 4.3.0

# Create a new project
mkdir myproject && cd myproject
ruv init --r-version 4.3.0

# Add packages
ruv add dplyr
ruv add ggplot2

# Generate lock file for reproducibility
ruv lock

# Activate the environment
ruv shell

Reproduce an Environment

git clone https://github.com/example/r-project
cd r-project
ruv sync    # Installs from ruv.lock

Commands

Command Description
ruv init Initialize a new project
ruv add <pkg> Add a package to dependencies
ruv remove <pkg> Remove a package
ruv sync Sync library with ruv.toml/ruv.lock
ruv lock Generate lock file
ruv shell Activate virtual environment
ruv run <cmd> Run command in environment
ruv r install <ver> Install R version
ruv r list List installed R versions

See docs/COMMANDS.md for detailed usage.

Project Structure

myproject/
├── ruv.toml          # Project configuration
├── ruv.lock          # Lock file (commit this!)
└── .ruv/
    ├── R-version     # Pinned R version
    ├── library/      # Installed packages
    └── bin/          # R, Rscript wrappers

ruv.toml

name = "myproject"
r_version = "4.3.0"
dependencies = ["dplyr", "ggplot2>=3.4.0"]
cran_mirror = "https://cloud.r-project.org"

Roadmap

Implemented

  • R version installation (from Posit prebuilt binaries)
  • Project initialization (ruv init)
  • Virtual environment with wrapper scripts
  • Package management (add, remove, sync)
  • Lock file generation and usage (ruv lock)
  • Shell activation (ruv shell)
  • Run commands in environment (ruv run)

Planned

  • Rust-native dependency resolution (currently delegates to R/pak)
  • Parallel package downloads in Rust
  • Binary package caching
  • Bioconductor support
  • GitHub/GitLab package sources
  • renv compatibility (import/export)
  • Windows support

Architecture

ruv (CLI)
├── ruv-core      # Config, Lockfile, Paths
├── ruv-r         # R toolchain management
├── ruv-cran      # CRAN client
└── ruv-install   # Package installer (WIP)

See docs/ARCHITECTURE.md for details.

Requirements

  • Linux (Ubuntu/Debian) or macOS
  • Rust 1.70+ (for building)

Building from Source

git clone https://github.com/RyoNakagami/ruv
cd ruv
cargo build --release
./target/release/ruv --help
cp ./target/release/ruv ~/.cargo/bin/

Uninstalling

Remove the binary

# If installed to ~/.cargo/bin/
rm ~/.cargo/bin/ruv

# Or if built locally
rm ./target/release/ruv

Remove global data

# Remove all installed R versions and cache
rm -rf ~/.local/share/ruv/

Remove project environments

# In each project directory
rm -rf .ruv/
rm ruv.toml ruv.lock

License

MIT

Acknowledgments

  • uv - Inspiration for the project design
  • pak - Fast R package installation
  • Posit R Builds - Prebuilt R binaries

About

ruv is a lightweight R version manager for seamless installation, management, and switching between multiple R versions on your system.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages