Last active
June 12, 2018 17:12
-
-
Save apoorvalal/dbf42ff6e931f8c02856bf15274b3d95 to your computer and use it in GitHub Desktop.
R-setup-on-linux
This file contains 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
rm(list=ls()) | |
wants <- c('tidyverse','AER','devtools','lfe','glmnet', | |
'data.table','ff','foreach','parallel','stargazer') | |
has <- wants %in% rownames(installed.packages()) | |
if(any(!has)) install.packages(wants[!has],dependencies=TRUE, | |
repos='http://cran.us.r-project.org') | |
sessionInfo() |
This file contains 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
#!/bin/bash | |
# Adds R to apt and install it | |
# | |
# Instructions: | |
# sudo chmod 700 InstallR.sh | |
# ./FirstTimeInstallR.sh | |
sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list | |
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 | |
gpg -a --export E084DAB9 | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install -y r-base r-base-dev r-cran-xml r-cran-rjava libcurl4-openssl-dev | |
sudo apt-get install -y libssl-dev libxml2-dev openjdk-7-* libgdal-dev libproj-dev libgsl-dev | |
sudo apt-get install -y xml2 default-jre default-jdk mesa-common-dev libglu1-mesa-dev freeglut3-dev | |
sudo apt-get install -y mesa-common-dev libx11-dev r-cran-rgl r-cran-rglpk r-cran-rsymphony r-cran-plyr | |
sudo apt-get install -y r-cran-reshape r-cran-reshape2 r-cran-rmysql | |
sudo R CMD javareconf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment