From 312494180d4644acba05ec133217748dec1f392b Mon Sep 17 00:00:00 2001 From: Michel Kuhlmann Date: Mon, 22 Feb 2016 08:52:22 +0100 Subject: nixpkgs manual: add basic R documentation, fixes #13362 also fixes #13243 --- pkgs/development/r-modules/README.md | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 pkgs/development/r-modules/README.md (limited to 'pkgs/development/r-modules/README.md') diff --git a/pkgs/development/r-modules/README.md b/pkgs/development/r-modules/README.md new file mode 100644 index 0000000000000..3a88f45b4ccbb --- /dev/null +++ b/pkgs/development/r-modules/README.md @@ -0,0 +1,55 @@ +R packages +========== + +## Installation + +Define an environment for R that contains all the libraries that you'd like to +use by adding the following snippet to your $HOME/.nixpkgs/config.nix file: + +```nix +{ + packageOverrides = super: let self = super.pkgs; in + { + + rEnv = super.rWrapper.override { + packages = with self.rPackages; [ + devtools + ggplot2 + reshape2 + yaml + optparse + ]; + }; + }; +} +``` + +Then you can use `nix-env -f "" -iA rEnv` to install it into your user +profile. The set of available libraries can be discovered by running the +command `nix-env -f "" -qaP -A rPackages`. The first column from that +output is the name that has to be passed to rWrapper in the code snipped above. + +## Updating the package set + +```bash +Rscript generate-r-packages.R cran > cran-packages.nix.new +mv cran-packages.nix.new cran-packages.nix + +Rscript generate-r-packages.R bioc > bioc-packages.nix.new +mv bioc-packages.nix.new bioc-packages.nix + +Rscript generate-r-packages.R irkernel > irkernel-packages.nix.new +mv irkernel-packages.nix.new irkernel-packages.nix +``` + +`generate-r-packages.R ` reads `-packages.nix`, therefor the renaming. + + +## Testing if the Nix-expression could be evaluated + +```bash +nix-build test-evaluation.nix --dry-run +``` + +If this exits fine, the expression is ok. If not, you have to edit `default.nix` + -- cgit 1.4.1