Skip to content

rinpharma/demo_rix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo: Using {rix} to manage R dependencies

This repository serves as a demonstration of using the {rix} package to manage R package dependencies while leveraging the Nix package manager. The R scripts in this repository originate from the Pharmaverse examples repository, and were also featured in the Package Management session examples:

Development Setup

Prerequisites

Workflow

  1. Start a new R session with the {rix} package available. Notice that we did not include R as a prerequisite. That is not an accidental ommission, as you can obtain a custom R environment directly with the Nix package manager by running the following command:
nix-shell -p R rPackages.rix

After the dependencies are installed, you will be in a new environment with R and the rix package available.

  1. Run the following command to create the Nix configuration file for this project:
Rscript build_config.R

You could also launch R itself in the shell and simply run source("build_config.R") if you wish. The result of this command will be the creation of default.nix, the configuration file used by Nix to create the project environment.

  1. Exit out of this particular Nix session by typing exit in the terminal. You should be returned to your default computer environment.
  2. Initialize the project environment and immediately enter a custom shell by running the following command:
nix-shell

Once the dependencies are installed, you will now be in a new Nix shell environment.

  1. Launch R either through the terminal or through an IDE such as Positron to run the scripts in this repository.

About

Demonstration of {rix} to manage R packages

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors