This is code and text behind the ggplot2 book. Please help us make it better by contributing!
You can build the pdf by cloning this repo and running make:
$ git clone https://github.com/hadley/ggplot2-book.git
$ cd ggplot2-book
$ make
If you use RStudio, you can press Cmd/Ctrl + Shift + B to run make.
There are a number of dependencies required to build this book. We have a full installation recipe for Ubuntu 12.04 here. Even if you run a different operating system, please look there for R package requirements.
All of the R packages are available on CRAN via install.packages
except for bookdown and captioner. You can install both
sets of packages with:
pkgs <- c("lubridate", "rvest", "magrittr", "gridExtra", "dplyr", "plyr",
"tidyr", "xtable", "nlme", "effects", "broom", "hexbin", "maps",
"maps", "Hmisc", "devtools")
reqs <- vapply(pkgs, require, character.only = TRUE, FUN.VALUE = logical(1))
# Install packages we require
if(any(!reqs)) install.packages(pkgs[!reqs])
devtools::install_github(c("adletaw/captioner", "hadley/bookdown"))
You might also need to install the inconsolata font.
To link between sections, use internal links of the form #header-id
.
All header references are listed in toc.yaml
.