| Title: | R package to manage dependencies with pixi |
|---|---|
| Description: | More about what it does (maybe more than one line) Use four spaces when indenting paragraphs within the Description. |
| Authors: | Mikkel Roald-Arbøl |
| Maintainer: | Mikkel Roald-Arbøl <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.3.0 |
| Built: | 2026-05-13 07:37:18 UTC |
| Source: | https://github.com/roaldarbol/rpix |
add() will add dependencies to the pixi.toml.
For more information, see https://pixi.sh/latest/reference/cli/pixi/add/.
It will only add if the package with its version constraint is able to work with rest of the dependencies in the project. More info on multi-platform configuration.
add(packages, versions = NULL, channel = NULL, dry_run = FALSE)add(packages, versions = NULL, channel = NULL, dry_run = FALSE)
packages |
Package name(s) to be added. |
versions |
Optional. Version constraints for all packages. |
channel |
Optional. Defaults to conda-forge, but other conda channels can be specified. |
dry_run |
Should the command be executed? If TRUE, the final pixi command will be shown but not executed. FALSE (default) executes the command. |
Doesn't return any objects.
## Not run: add("tibble") ## End(Not run)## Not run: add("tibble") ## End(Not run)
pixi_to_path() checks if pixi's installation directory is in the current PATH
and adds it if not found. The function automatically detects the operating system
and uses the appropriate default installation path for each platform.
pixi_to_path()pixi_to_path()
The function checks if the pixi binary directory is already present in the PATH environment variable. If not found, it appends the default installation directory:
macOS/Linux: ~/.pixi/bin
Windows: %USERPROFILE%\\.pixi\\bin
This modification only affects the current R session.
Invisibly returns NULL. The function is called for its side effects
of modifying the PATH environment variable.
Sys.setenv(), Sys.getenv(), Sys.info()
## Not run: # Check if pixi is available and add to PATH if needed pixi_to_path() # Verify pixi is now available system("pixi --version") ## End(Not run)## Not run: # Check if pixi is available and add to PATH if needed pixi_to_path() # Verify pixi is now available system("pixi --version") ## End(Not run)
remove() will remove dependencies from the pixi.toml.
For more information, see https://pixi.sh/latest/reference/cli/pixi/remove/
remove(packages, dry_run = FALSE)remove(packages, dry_run = FALSE)
packages |
Package name(s) to be removed. |
dry_run |
Just show command or also run. |
Doesn't return any objects.
## Not run: remove("tibble") ## End(Not run)## Not run: remove("tibble") ## End(Not run)
reset_r_libraries() resets R's library configuration to default settings,
removing any pixi-specific configurations. This is useful for troubleshooting
or when you want to stop using pixi-managed packages.
reset_r_libraries(remove_from_rprofile = FALSE, global = FALSE)reset_r_libraries(remove_from_rprofile = FALSE, global = FALSE)
remove_from_rprofile |
Logical. If TRUE, attempts to remove pixi setup from .Rprofile files. Default is FALSE. |
global |
Logical. If TRUE and |
## Not run: # Reset library paths to default reset_r_libraries() # Reset and clean .Rprofile reset_r_libraries(remove_from_rprofile = TRUE) ## End(Not run)## Not run: # Reset library paths to default reset_r_libraries() # Reset and clean .Rprofile reset_r_libraries(remove_from_rprofile = TRUE) ## End(Not run)
To ensure that RStudio uses the correct version of R and avoid errors when loading libraries, use this command to restart RStudio.
restart_rstudio_with_pixi()restart_rstudio_with_pixi()
search() searches for available versions of a conda package and displays
their dependencies. This is useful for exploring what versions are available
before adding a package to your pixi project. The search shows version
information and dependency requirements for each version found.
When called without arguments, it behaves like base R's search() function
and returns the current search path.
search(package, channel = NULL, dry_run = FALSE)search(package, channel = NULL, dry_run = FALSE)
package |
Package name to search for. Will be automatically prefixed with "r-" for R packages. If missing, returns the search path like base R's search(). |
channel |
Optional. Defaults to conda-forge, but other conda channels can be specified to search in specific repositories. |
dry_run |
Should the command be executed? If TRUE, the final pixi command will be shown but not executed. FALSE (default) executes the command. |
When package is provided: doesn't return objects, displays search
results in console. When package is missing: returns character vector of
search path (like base R's search()).
## Not run: # Search for available versions of tibble search("tibble") # Search in a specific channel search("numpy", channel = "conda-forge") # Just show the command without running it search("dplyr", dry_run = TRUE) # Get search path (like base R) search() ## End(Not run)## Not run: # Search for available versions of tibble search("tibble") # Search in a specific channel search("numpy", channel = "conda-forge") # Just show the command without running it search("dplyr", dry_run = TRUE) # Get search path (like base R) search() ## End(Not run)
setup_pixi() provides a complete pixi setup for R projects. It checks for
pixi availability, initializes a pixi project if needed, and configures R
to use pixi-managed packages. The function prioritizes safety and uses
.libPaths() instead of environment variables to avoid shared library conflicts.
setup_pixi(add_to_rprofile = TRUE, global = FALSE, init_if_missing = TRUE)setup_pixi(add_to_rprofile = TRUE, global = FALSE, init_if_missing = TRUE)
add_to_rprofile |
Logical. If TRUE, adds the pixi library configuration to .Rprofile for persistence across sessions. Default is FALSE. |
global |
Logical. If TRUE and |
init_if_missing |
Logical. If TRUE, runs |
The function performs the following steps:
Checks if pixi is available in PATH (adds it if not found)
Checks for pixi.toml in project root (runs pixi init if not found)
Configures R to use the pixi library as the primary package source
Optionally adds the configuration to .Rprofile for persistence
Instead of setting environment variables (which can cause shared library conflicts), this function modifies .libPaths() to prioritize the pixi library.
Invisibly returns a list with the status of each setup step.
## Not run: # Basic setup - just configure for current session setup_pixi() # Full setup - add to .Rprofile for persistence setup_pixi(add_to_rprofile = TRUE) # Setup without auto-initializing pixi project setup_pixi(init_if_missing = FALSE) ## End(Not run)## Not run: # Basic setup - just configure for current session setup_pixi() # Full setup - add to .Rprofile for persistence setup_pixi(add_to_rprofile = TRUE) # Setup without auto-initializing pixi project setup_pixi(init_if_missing = FALSE) ## End(Not run)