Faster R package Installation

Setting up R in a new work environment consumes a lot of time as installtion and building of packages and associated dependencies is single threaded by default.

Install dependencies concurrently

Ncpu

Set MAKEFLAGS env variable

Sys.setenv(MAKEFLAGS = sprintf(“-j%d”, parallel::detectCores())) #Set the number of cores

Use CCache

Other methos of improvement

  • Select a faster mirror
  • Install binaries from Ubuntu repo
  • Use Conda/Miniconda to manage dependencies



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Fixing ImageMagick convert not found error in Cloudflare Pages [Jekyll Build]
  • Install and Configure Jupyter Notebook Server on CentOS 7
  • Jupyter Notebook on SGE Cluster with Reverse Tunneling