diff options
Diffstat (limited to 'pkgs/development/r-modules/README.md')
-rw-r--r-- | pkgs/development/r-modules/README.md | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/pkgs/development/r-modules/README.md b/pkgs/development/r-modules/README.md index e384b375460a..cb962e138c50 100644 --- a/pkgs/development/r-modules/README.md +++ b/pkgs/development/r-modules/README.md @@ -4,7 +4,7 @@ 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: +use by adding the following snippet to your $HOME/.config/nixpkgs/config.nix file: ```nix { @@ -53,6 +53,37 @@ in with pkgs; { and then run `nix-shell .` to be dropped into a shell with those packages available. +## RStudio + +RStudio by default will not use the libraries installed like above. +You must override its R version with your custom R environment, and +set `useRPackages` to `true`, like below: + +```nix +{ + packageOverrides = super: let self = super.pkgs; in + { + + rEnv = super.rWrapper.override { + packages = with self.rPackages; [ + devtools + ggplot2 + reshape2 + yaml + optparse + ]; + }; + rstudioEnv = super.rstudio.override { + R = rEnv; + useRPackages = true; + }; + }; +} +``` + +Then like above, `nix-env -f "<nixpkgs>" -iA rstudioEnv` will install +this into your user profile. + ## Updating the package set ```bash |