We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfbfd8b commit 329567cCopy full SHA for 329567c
tools/scripts/install_r_pkgs.R
@@ -0,0 +1,19 @@
1
+#!/usr/bin/env Rscript
2
+#
3
+# Installs R packages.
4
5
+# The script is called with one or more arguments, where each argument is a
6
+# package name to install.
7
+
8
+# Get only the trailing command-line arguments:
9
+args <- commandArgs( trailingOnly = TRUE );
10
11
+# Check that at least one package name has been provided...
12
+n <- length( args );
13
+if ( n == 0 ) {
14
+ stop( "Must provide at least one package to install.", call. = FALSE );
15
+}
16
+# Install each package...
17
+for ( i in 1:n ) {
18
+ install.packages( args[ i ], repos = "http://lib.stat.cmu.edu/R/CRAN/" );
19
0 commit comments