Created
October 20, 2017 19:50
-
-
Save sellorm/ee81d4ad42831f0fc6951c987fe2bb37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
pkg=${1} | |
function help { | |
echo "Usage: $(basename $0) <package name>" | |
exit 1 | |
} | |
[ -z ${pkg} ] && help | |
REXEC=$(which R) | |
if [ -z ${REXEC} ]; then | |
echo "R not found, please ensure R is available and try again." | |
exit 1 | |
fi | |
echo "install.packages(\"${pkg}\", repos=\"https://cran.rstudio.com\")" | R --no-save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment