Manage R project dependencies with Pixi
rpix lets you use Pixi from R. Pixi installs R itself, R packages and the system libraries they need (such as GDAL) from conda-forge into an environment inside your project. It records the exact versions in a lock file, so the project runs the same on every computer.
Installation
Install rpix in the R you normally use, then let it install Pixi:
install.packages(
"rpix",
repos = c("https://roaldarbol.r-universe.dev", "https://cloud.r-project.org")
)
rpix::install_pixi()Example
Set up the project in the working directory, for your IDE. This creates a Pixi project, adds R and rpix to it, and points the IDE at that R. Until rpix is on conda-forge, it comes from the rpix-forge channel, which is added to the project after conda-forge:
rpix::use_pixi(ide = "positron") # or "rstudio", or "vscode"From then on, work in R started by Pixi: in your IDE (see Using rpix with an IDE), or with pixi run R in a terminal in the project folder. Add and remove packages from there:
A package that isn’t on conda-forge or bioconda can be built from source, which pixi_add() offers. Together, that’s 80% of CRAN and nearly all of Bioconductor.
pixi_sitrep() checks the setup, and suggests fixes if something’s off.
To start a new project from a template instead, see r-template.
Learn more
- Get started: from installing Pixi to sharing a project.
- How rpix works: why each environment has its own R.
- Finding packages: CRAN, Bioconductor and other conda packages.
- Several environments: another version of R, or extra packages for tests.
- Coming from renv: renv’s functions and their rpix counterparts.
For coding agents
rpix comes with an agent skill, so coding agents such as Claude Code, Codex and Cursor add packages through Pixi, run the project’s R, and start from pixi_sitrep() when something’s off. In Claude Code:
/plugin marketplace add roaldarbol/rpix
/plugin install rpix@rpix
For other agents that read Agent Skills, copy the skills/rpix folder to where they look for skills.
Getting help
Ask questions and share ideas in GitHub Discussions, and report bugs in the issues. For Pixi itself, ask on the Discord of prefix.dev, the makers of Pixi.
Fun fact: rpix is inspired by the Danish word harpiks, which means resin. I see it as the resin that binds Pixi into the natural R workflow.