summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichel Kuhlmann <michel@kuhlmanns.info>2016-02-22 08:52:22 +0100
committerRok Garbas <rok@garbas.si>2016-02-22 10:16:06 +0100
commit312494180d4644acba05ec133217748dec1f392b (patch)
treeae93a4e7f6be1ba721c2df8d9a1252a32db3eb67
parentf1a65b3443cab0f155baf62391991581e062d9df (diff)
downloadnixpkgs-312494180d4644acba05ec133217748dec1f392b.tar
nixpkgs-312494180d4644acba05ec133217748dec1f392b.tar.gz
nixpkgs-312494180d4644acba05ec133217748dec1f392b.tar.bz2
nixpkgs-312494180d4644acba05ec133217748dec1f392b.tar.lz
nixpkgs-312494180d4644acba05ec133217748dec1f392b.tar.xz
nixpkgs-312494180d4644acba05ec133217748dec1f392b.tar.zst
nixpkgs-312494180d4644acba05ec133217748dec1f392b.zip
nixpkgs manual: add basic R documentation, fixes #13362
also fixes #13243
-rw-r--r--doc/default.nix5
-rw-r--r--doc/languages-frameworks/index.xml1
-rw-r--r--pkgs/development/r-modules/README.md55
3 files changed, 60 insertions, 1 deletions
diff --git a/doc/default.nix b/doc/default.nix
index 65e12254f78..196b9e44539 100644
--- a/doc/default.nix
+++ b/doc/default.nix
@@ -56,8 +56,11 @@ stdenv.mkDerivation {
       inputFile = ./../pkgs/development/idris-modules/README.md;
       outputFile = "languages-frameworks/idris.xml";
     }
+  + toDocbook {
+      inputFile = ./../pkgs/development/r-modules/README.md;
+      outputFile = "languages-frameworks/r.xml";
+    }
   + ''
-    cat languages-frameworks/idris.xml
     echo ${nixpkgsVersion} > .version
 
     xmllint --noout --nonet --xinclude --noxincludenode \
diff --git a/doc/languages-frameworks/index.xml b/doc/languages-frameworks/index.xml
index 743a1b70be7..e63ff3ab140 100644
--- a/doc/languages-frameworks/index.xml
+++ b/doc/languages-frameworks/index.xml
@@ -21,6 +21,7 @@ such as Perl or Haskell.  These are described in this chapter.</para>
 <xi:include href="lua.xml" />
 <xi:include href="coq.xml" />
 <xi:include href="idris.xml" /> <!-- generated from ../../pkgs/development/idris-modules/README.md  -->
+<xi:include href="r.xml" /> <!-- generated from ../../pkgs/development/r-modules/README.md  -->
 <xi:include href="qt.xml" />
 
 
diff --git a/pkgs/development/r-modules/README.md b/pkgs/development/r-modules/README.md
new file mode 100644
index 00000000000..3a88f45b4cc
--- /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 "<nixpkgs>" -iA rEnv` to install it into your user
+profile. The set of available libraries can be discovered by running the
+command `nix-env -f "<nixpkgs>" -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 <repo>` reads  `<repo>-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`
+