Skip to content

Instantly share code, notes, and snippets.

@david-hammond
david-hammond / RstudioServerSetup.sh
Created January 30, 2018 01:00 — forked from kdkorthauer/RstudioServerSetup.sh
Bash script to set up R, install a few R packages, and get Rstudio Server running on ubuntu.
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /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 -y install r-base libapparmor1 libcurl4-gnutls-dev libxml2-dev libssl-dev gdebi-core
sudo apt-get install libcairo2-dev
sudo apt-get install libxt-dev
sudo apt-get install git-core
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
@david-hammond
david-hammond / ipak.R
Last active January 26, 2018 05:50 — forked from stevenworthington/ipak.R
Install and load multiple R packages at once
# ipak function: install and load multiple R packages.
# check to see if packages are installed. Install them if they are not, then load them into the R session.
ipak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
@david-hammond
david-hammond / .Rbuildignore
Created July 24, 2017 23:08 — forked from dsparks/Hmisc_bezier.R
Economics-style graphs
^.*\.Rproj$
^\.Rproj\.user$