Skip to content

Instantly share code, notes, and snippets.

@walshc
Last active May 26, 2016 23:41
Show Gist options
  • Save walshc/28fb754ea9ff95fbae7c6f3b14ac15de to your computer and use it in GitHub Desktop.
Save walshc/28fb754ea9ff95fbae7c6f3b14ac15de to your computer and use it in GitHub Desktop.
Install latest R to ~/.local.
#!/bin/bash
R_VERSION="3.2.5"
wget https://cran.r-project.org/src/base/R-3/R-$R_VERSION.tar.gz
tar -xvf R-$R_VERSION.tar.gz
rm R-$R_VERSION.tar.gz
cd R-$R_VERSION
# If ~/.local/bin doesn't exist, create it:
if [ ! -d "$HOME/.local/bin" ]; then
mkdir -p $HOME/.local/bin
fi
./configure --prefix=$HOME/.local/
make
make install
# If ~/.local/bin is not already in $PATH, add it:
if ! [[ ":$PATH" == *":$HOME/.local/bin:"* ]]; then
echo "Adding ~/.local/bin to PATH"
echo "export PATH="\$HOME/local/bin:\$PATH"" >> ~/.bashrc
source ~/.bashrc
fi
rm -r R-$R_VERSION
echo "Installation complete"
@walshc
Copy link
Author

walshc commented May 4, 2016

Instructions

At the command line, enter:
curl https://gist.githubusercontent.com/walshc/28fb754ea9ff95fbae7c6f3b14ac15de/raw/cdca7b9894ef8c458a7fd00a4c83e1bd819d362a/installr.sh | sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment