3.2 Installing from GitHub

Some packages that have not yet had an official release are in development on GitHub. As a result, these packages change very often and are more unstable than their official counterparts. We can install packages from Github using the devtools package. To install this, type:

install.packages("devtools", dependencies=TRUE)

Here, dependencies=TRUE ensures that if we need other packages to make devtools work, R will install these as well. Depending on your operating system, you might have to install some other software for devtools to work.

On Windows, devtools requires the RTools software. To install this, go to https://cran.r-project.org/bin/windows/Rtools/, download the latest recommended version (in green), and install it. Then re-open R again and install devtools as shown above.

On Linux, the way you install devtools depends on the flavour of Linux you have. In most cases, installing `devtools’ from the RStudio console will work fine. If not, the problem is most likely a missing package in your Linux distribution. To fix this, close R, open a terminal and type:

  1. sudo apt-get update
  2. sudo apt-get upgrade
  3. sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
  4. Close the terminal, open R, and install devtools as shown above.

On OSX (or macOS), devtools requires the XCode software. To install this, follow these steps:

  1. Launch the terminal (which you can find in /Applications/Utilities/), and type:
  2. In the terminal, type: xcode-select --install
  3. A software update window should pop up. Here, click Install and agree to the Terms of Service.
  4. Go to R and install devtools as shown above.