Install rpx
rpx is a CLI for managing R package project dependencies. It requires R to be installed and available on PATH.
Prerequisites
Rscript should be available in your shell before you use rpx.
- Windows: https://cran.r-project.org/bin/windows/base/
- macOS: https://cran.r-project.org/bin/macosx/
- CRAN mirrors: https://cran.r-project.org/mirrors.html
Windows currently uses Cargo as the recommended install path, so you also need the Rust toolchain:
- Rust: https://rustup.rs/
- Windows Rust/MSVC prerequisites: https://rust-lang.github.io/rustup/installation/windows-msvc.html
rpx prefers binary R package artifacts on Windows and macOS when they are available, but some packages may still need a source build. On Windows, install Rtools if you hit source-build requirements:
macOS and Linux
Install the latest stable release with the shell installer:
curl -LsSf https://rrepo.org/rpx/latest/rpx-installer.sh | sh
Windows
Install the latest stable release with PowerShell:
irm https://rrepo.org/rpx/latest/rpx-installer.ps1 | iex
You can also install rpx from source with Cargo:
cargo install --git https://github.com/scalerail-solutions/rpx.git
Windows is supported, but the native signed installer flow is still in progress.
Other install options
Rust users on other platforms can also install from source:
cargo install --git https://github.com/scalerail-solutions/rpx.git
You can also run the Docker image directly:
docker run --rm ghcr.io/scalerail-solutions/rpx:latest --help
The Docker image contains the rpx binary but does not include R. For project workflows, copy rpx into an image that already provides R:
FROM r-base:latest
COPY --link --from=ghcr.io/scalerail-solutions/rpx:latest /rpx /usr/local/bin/rpx
View releases and source code on rpx GitHub.
Next step
Create a project with rpx init, or run rpx lock in an existing R package project with a DESCRIPTION file. Read Repositories when you need to add private or fallback package sources.