rix {rix} | R Documentation |
Generate a Nix expression that builds a reproducible development environment
rix(
r_ver = "latest",
r_pkgs = NULL,
system_pkgs = NULL,
git_pkgs = NULL,
local_r_pkgs = NULL,
tex_pkgs = NULL,
ide = c("other", "code", "radian", "rstudio", "rserver"),
project_path,
overwrite = FALSE,
print = FALSE,
message_type = "simple",
shell_hook = NULL
)
r_ver |
Character, defaults to "latest". The required R version, for
example "4.0.0". You can check which R versions are available using
|
r_pkgs |
Vector of characters. List the required R packages for your analysis here. |
system_pkgs |
Vector of characters. List further software you wish to install that are not R packages such as command line applications for example. You can look for available software on the NixOS website https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query= # nolint |
git_pkgs |
List. A list of packages to install from Git. See details for more information. |
local_r_pkgs |
List. A list of local packages to install. These packages
need to be in the |
tex_pkgs |
Vector of characters. A set of TeX packages to install. Use
this if you need to compile |
ide |
Character, defaults to "other". If you wish to use RStudio to work interactively use "rstudio" or "rserver" for the server version. Use "code" for Visual Studio Code. You can also use "radian", an interactive REPL. For other editors, use "other". This has been tested with RStudio, VS Code and Emacs. If other editors don't work, please open an issue. |
project_path |
Character. Where to write |
overwrite |
Logical, defaults to FALSE. If TRUE, overwrite the
|
print |
Logical, defaults to FALSE. If TRUE, print |
message_type |
Character. Message type, defaults to |
shell_hook |
Character of length 1, defaults to It is possible to use environments built with Nix interactively, either
from the terminal, or using an interface such as RStudio. If you want to
use RStudio, set the Packages to install from Github or Gitlab must be provided in a list of 3
elements: "package_name", "repo_url" and "commit". To install several
packages, provide a list of lists of these 3 elements, one per package to
install. It is also possible to install old versions of packages by
specifying a version. For example, to install the latest version of Note that installing packages from Git or old versions using the By default, the Nix shell will be configured with It is possible to use |
Nothing, this function only has the side-effect of writing two files:
default.nix
and .Rprofile
in the working directory. default.nix
contains a Nix expression to build a reproducible environment using the Nix
package manager, and .Rprofile
ensures that a running R session from a
Nix environment cannot access local libraries, nor install packages using
install.packages()
(nor remove nor update them).
## Not run:
# Build an environment with the latest version of R
# and the dplyr and ggplot2 packages
rix(
r_ver = "latest",
r_pkgs = c("dplyr", "ggplot2"),
system_pkgs = NULL,
git_pkgs = NULL,
local_r_pkgs = NULL,
ide = "code",
project_path = path_default_nix,
overwrite = TRUE,
print = TRUE,
message_type = "simple",
shell_hook = NULL
)
## End(Not run)