# rpix *Manage R project dependencies with Pixi* rpix lets you use [Pixi](https://pixi.prefix.dev) from R. Pixi installs R itself, R packages and the system libraries they need (such as GDAL) from [conda-forge](https://conda-forge.org) 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](https://pixi.prefix.dev/latest/installation/): ``` r 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](https://prefix.dev/channels/rpix-forge) channel, which is added to the project after conda-forge: ``` r 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](https://roald-arboel.com/rpix/articles/ide.html)), or with `pixi run R` in a terminal in the project folder. Add and remove packages from there: ``` r library(rpix) pixi_add(c("dplyr", "ggplot2")) pixi_add("bioc::DESeq2") pixi_remove("ggplot2") ``` A package that isn’t on conda-forge or bioconda can be built from source, which [`pixi_add()`](https://roald-arboel.com/rpix/reference/pixi_add.md) offers. Together, that’s [80% of CRAN and nearly all of Bioconductor](https://roald-arboel.com/rpix/articles/package-availability.html). [`pixi_sitrep()`](https://roald-arboel.com/rpix/reference/pixi_sitrep.md) checks the setup, and suggests fixes if something’s off. To start a new project from a template instead, see [r-template](https://github.com/roaldarbol/r-template). ## Learn more - [Get started](https://roald-arboel.com/rpix/articles/getting-started.html): from installing Pixi to sharing a project. - [How rpix works](https://roald-arboel.com/rpix/articles/how-rpix-works.html): why each environment has its own R. - [Finding packages](https://roald-arboel.com/rpix/articles/finding-packages.html): CRAN, Bioconductor and other conda packages. - [Several environments](https://roald-arboel.com/rpix/articles/environments.html): another version of R, or extra packages for tests. - [Coming from renv](https://roald-arboel.com/rpix/articles/coming-from-renv.html): 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()`](https://roald-arboel.com/rpix/reference/pixi_sitrep.md) when something’s off. In Claude Code: /plugin marketplace add roaldarbol/rpix /plugin install rpix@rpix For other agents that read [Agent Skills](https://agentskills.io), copy the [`skills/rpix`](https://github.com/roaldarbol/rpix/tree/main/skills/rpix) folder to where they look for skills. ## Getting help Ask questions and share ideas in [GitHub Discussions](https://github.com/roaldarbol/rpix/discussions), and report bugs in the [issues](https://github.com/roaldarbol/rpix/issues). For Pixi itself, ask on the [Discord of prefix.dev](https://discord.com/invite/kKV8ZxyzY4), 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.* # Package index ## Managing dependencies - [`pixi_add()`](https://roald-arboel.com/rpix/reference/pixi_add.md) : Add packages - [`pixi_remove()`](https://roald-arboel.com/rpix/reference/pixi_remove.md) : Remove packages - [`pixi_search()`](https://roald-arboel.com/rpix/reference/pixi_search.md) : Search for packages - [`pixi_scan()`](https://roald-arboel.com/rpix/reference/pixi_scan.md) : Find packages the project's code uses - [`pixi_install()`](https://roald-arboel.com/rpix/reference/pixi_install.md) [`pixi_update()`](https://roald-arboel.com/rpix/reference/pixi_install.md) [`pixi_upgrade()`](https://roald-arboel.com/rpix/reference/pixi_install.md) [`pixi_lock()`](https://roald-arboel.com/rpix/reference/pixi_install.md) : Install and update the project's packages - [`pixi_set_date()`](https://roald-arboel.com/rpix/reference/pixi_set_date.md) : Use packages as they were on a date ## Environments, channels and platforms - [`pixi_environments()`](https://roald-arboel.com/rpix/reference/pixi_environments.md) [`pixi_add_environment()`](https://roald-arboel.com/rpix/reference/pixi_environments.md) [`pixi_remove_environment()`](https://roald-arboel.com/rpix/reference/pixi_environments.md) : Features and environments - [`pixi_switch()`](https://roald-arboel.com/rpix/reference/pixi_switch.md) : Switch to another environment's R - [`pixi_r()`](https://roald-arboel.com/rpix/reference/pixi_r.md) : Run a function in another environment's R - [`pixi_add_channel()`](https://roald-arboel.com/rpix/reference/pixi_add_channel.md) [`pixi_add_platform()`](https://roald-arboel.com/rpix/reference/pixi_add_channel.md) [`pixi_remove_channel()`](https://roald-arboel.com/rpix/reference/pixi_add_channel.md) [`pixi_remove_platform()`](https://roald-arboel.com/rpix/reference/pixi_add_channel.md) : Add or remove the project's channels and platforms ## Developing a package - [`pixi_import_description()`](https://roald-arboel.com/rpix/reference/pixi_import_description.md) : Add a package's dependencies from its DESCRIPTION - [`pixi_check_matrix()`](https://roald-arboel.com/rpix/reference/pixi_check_matrix.md) [`use_pixi_check_matrix()`](https://roald-arboel.com/rpix/reference/pixi_check_matrix.md) : Test a package in several environments - [`use_pixi_github_action()`](https://roald-arboel.com/rpix/reference/use_pixi_github_action.md) : Set up GitHub Actions with the project's Pixi environments ## Private channels - [`pixi_auth_login()`](https://roald-arboel.com/rpix/reference/pixi_auth_login.md) [`pixi_auth_logout()`](https://roald-arboel.com/rpix/reference/pixi_auth_login.md) [`pixi_auth_status()`](https://roald-arboel.com/rpix/reference/pixi_auth_login.md) : Log in to private channels ## Tasks - [`pixi_tasks()`](https://roald-arboel.com/rpix/reference/pixi_tasks.md) [`pixi_run()`](https://roald-arboel.com/rpix/reference/pixi_tasks.md) [`pixi_add_task()`](https://roald-arboel.com/rpix/reference/pixi_tasks.md) [`pixi_remove_task()`](https://roald-arboel.com/rpix/reference/pixi_tasks.md) : Pixi tasks ## Inspecting a project - [`pixi_sitrep()`](https://roald-arboel.com/rpix/reference/pixi_sitrep.md) : Report on the project's Pixi setup - [`pixi_info()`](https://roald-arboel.com/rpix/reference/pixi_info.md) [`pixi_list()`](https://roald-arboel.com/rpix/reference/pixi_info.md) [`pixi_tree()`](https://roald-arboel.com/rpix/reference/pixi_info.md) : Information about a Pixi project ## Setting up a project - [`install_pixi()`](https://roald-arboel.com/rpix/reference/install_pixi.md) : Install Pixi - [`use_pixi()`](https://roald-arboel.com/rpix/reference/use_pixi.md) : Set up a Pixi project for R - [`use_pixi_rstudio()`](https://roald-arboel.com/rpix/reference/use_pixi_ide.md) [`use_pixi_positron()`](https://roald-arboel.com/rpix/reference/use_pixi_ide.md) [`use_pixi_vscode()`](https://roald-arboel.com/rpix/reference/use_pixi_ide.md) [`use_pixi_emacs()`](https://roald-arboel.com/rpix/reference/use_pixi_ide.md) [`use_pixi_neovim()`](https://roald-arboel.com/rpix/reference/use_pixi_ide.md) [`use_pixi_zed()`](https://roald-arboel.com/rpix/reference/use_pixi_ide.md) : Set up an IDE for a Pixi project - [`use_pixi_direnv()`](https://roald-arboel.com/rpix/reference/use_pixi_direnv.md) : Activate the project's environment with direnv - [`use_pixi_jupyter()`](https://roald-arboel.com/rpix/reference/use_pixi_jupyter.md) : Use Jupyter notebooks with the project's R - [`use_pixi_python()`](https://roald-arboel.com/rpix/reference/use_pixi_python.md) : Use Python alongside R, for reticulate - [`pixi_import_renv()`](https://roald-arboel.com/rpix/reference/pixi_import_renv.md) : Move a project from renv - [`pixi_activate()`](https://roald-arboel.com/rpix/reference/pixi_activate.md) : Activate the project's Pixi environment in the running R # Articles ### Get started - [Get started](https://roald-arboel.com/rpix/articles/getting-started.md): ### Guides - [Using rpix with an IDE](https://roald-arboel.com/rpix/articles/ide.md): - [Finding packages](https://roald-arboel.com/rpix/articles/finding-packages.md): - [Several environments](https://roald-arboel.com/rpix/articles/environments.md): - [Developing a package](https://roald-arboel.com/rpix/articles/package-development.md): - [Coming from renv](https://roald-arboel.com/rpix/articles/coming-from-renv.md): - [Python alongside R](https://roald-arboel.com/rpix/articles/python.md): - [Sharing and reproducibility](https://roald-arboel.com/rpix/articles/reproducibility.md): - [Private channels and company networks](https://roald-arboel.com/rpix/articles/private-channels.md): ### Background - [How rpix works](https://roald-arboel.com/rpix/articles/how-rpix-works.md): - [How many packages you can use](https://roald-arboel.com/rpix/articles/package-availability.md): - [rpix and similar tools](https://roald-arboel.com/rpix/articles/similar-tools.md): - [Troubleshooting](https://roald-arboel.com/rpix/articles/troubleshooting.md):