Skip to content

Instantly share code, notes, and snippets.

@ColinFay
Created November 13, 2019 09:49
Show Gist options
  • Save ColinFay/b38fe4ff1ba3d8f71a83406396a49aaf to your computer and use it in GitHub Desktop.
Save ColinFay/b38fe4ff1ba3d8f71a83406396a49aaf to your computer and use it in GitHub Desktop.
Installing R from source

Install R from source

Set R version and dl it

(you can modify the cran mirror)

R_VERSION='3.6.1'
wget https://cran.univ-paris1.fr/src/base/R-3/R-${R_VERSION}.tar.gz

Untar and cd to the dir

sudo tar -xzvf R-${R_VERSION}.tar.gz
cd R-${R_VERSION}

Configure (possible to remove params but these are the one I usually set)

sudo ./configure \
  --prefix=/opt/R/${R_VERSION} \
  --enable-memory-profiling \
  --enable-R-shlib \
  --with-blas \
  --with-cairo=yes \
  --with-lapack \
  --with-libpng=yes \
  --with-x

Make

sudo make; sudo make install

Verify it's installed

make check

Check it's installed

/opt/R/${R_VERSION}/bin/R --version

Add to your path

export PATH=$PATH:/opt/R/${R_VERSION}/bin

More info:

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