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:
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:
sudo apt-get update
sudo apt-get upgrade
sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
- 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:
- Launch the terminal (which you can find in /Applications/Utilities/), and type:
- In the terminal, type:
xcode-select --install
- A software update window should pop up. Here, click Install and agree to the Terms of Service.
- Go to R and install
devtools
as shown above.