Installing Packages From Other Repositories

Not all packages are hosted on public R repositories. Luckily, you can get a package that makes it easy to install packages from other places. The devtools library includes tools for installing packages from popular git repositories and other URLs. (We’ll use devtools later in the book to install R/Hadoop from GitHub.)

For example, Hadley Wickham uses GitHub to host the development version of ggplot2. To install the latest development version of ggplot2, you can use the following command:

> # if you haven't installed devtools, start with this command:
> install.packages("devtools")

> # otherwise just type this
> library(devtools)
> install_github("ggplot2")

For more information, see the help file for devtools.

Get R in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.