|
| 1 | +--- |
| 2 | +output: github_document |
| 3 | +--- |
| 4 | + |
| 5 | +<!-- README.md is generated from README.Rmd. Please edit that file --> |
| 6 | + |
| 7 | +```{r, echo = FALSE} |
| 8 | +knitr::opts_chunk$set( |
| 9 | + collapse = TRUE, |
| 10 | + comment = "#>", |
| 11 | + fig.path = "README-" |
| 12 | +) |
| 13 | +``` |
| 14 | + |
| 15 | +# ggplot2 <img src="logo.png" align="right" /> |
| 16 | + |
| 17 | +[](https://travis-ci.org/tidyverse/ggplot2) |
| 18 | +[](https://codecov.io/github/tidyverse/ggplot2?branch=master) |
| 19 | +[](http://cran.r-project.org/package=ggplot2) |
| 20 | + |
| 21 | +## Overview |
| 22 | + |
| 23 | +ggplot2 is a system for declaratively creating graphics, based on [The Grammar of Graphics](http://amzn.to/2ef1eWp). You provide the data, tell ggplot2 how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details. |
| 24 | + |
| 25 | +## Installation |
| 26 | + |
| 27 | +```{r, eval = FALSE} |
| 28 | +# The easiest way to get ggplot2 is to install the whole tidyverse: |
| 29 | +install.packages("tidyverse") |
| 30 | +
|
| 31 | +# Alternatively, install just readr: |
| 32 | +install.packages("ggplot2") |
| 33 | +
|
| 34 | +# Or the the development version from GitHub: |
| 35 | +# install.packages("devtools") |
| 36 | +devtools::install_github("tidyverse/ggplot2") |
| 37 | +``` |
| 38 | + |
| 39 | +## Learning ggplot2 |
| 40 | + |
| 41 | +ggplot2 is a comprehensive system for generating visualisations, so if you are new to ggplot2 you are better off starting with a systematic introduction, rather than trying to learn from reading individual documentation pages. Currently, there are three good places to start: |
| 42 | + |
| 43 | +1. The [data visualisation][r4ds-vis] and |
| 44 | + [graphics forcommunication][r4ds-comm] chapters in |
| 45 | + [R for data science][r4ds]. R for data science is designed to |
| 46 | + give you a comprehensive introduction to the |
| 47 | + [tidyverse](http://tidyverse.org), and these two chapters will |
| 48 | + you get up to speed with the essentials of ggplot2 as quickly as |
| 49 | + possible. |
| 50 | + |
| 51 | +1. If you'd like to take an interactive online course, try |
| 52 | + [Data visualisation with ggplot2][datacamp] by Rick Scavetta |
| 53 | + on datacamp. |
| 54 | + |
| 55 | +1. If you want to dive into making common graphics as quickly |
| 56 | + as possible, I recommend [The R Graphics Cookbook][cookbook] |
| 57 | + by Winston Chang. It provides a set of recipes to solve common |
| 58 | + graphics problems. A 2nd edition will is due out in 2017. |
| 59 | + |
| 60 | +If you've mastered the basics and want to learn more, read [ggplot2: Elegant Graphics for Data Analysis][ggplot2-book]. It describes the theoretical underpinnings of ggplot2 and shows you how all the pieces fit together. This book helps you understand the theory that underpins ggplot2, and will help you create new types of graphic specifically tailored to your needs. The book is not available for free, but you can find the complete source for the book at <https://github.com/hadley/ggplot2-book>. |
| 61 | + |
| 62 | +## Getting help |
| 63 | + |
| 64 | +There are two main places to get help with ggplot2: |
| 65 | + |
| 66 | +1. The [ggplot2 mailing list][ml] is a friendly place to ask any |
| 67 | + questions about ggplot2. You must be a member to post messages, |
| 68 | + but anyone can read the archived discussions. |
| 69 | + |
| 70 | +1. [stackoverflow](so) is a great source of answers to common ggplot2 |
| 71 | + questions. It is also a great place to get help, once you have |
| 72 | + created a reproducible example that illustrates your problem. |
| 73 | + |
| 74 | +[ggplot2-book]: http://amzn.to/2fncG50 |
| 75 | +[gg-book]: http://amzn.to/2ef1eWp |
| 76 | +[ml]: https://groups.google.com/forum/?fromgroups#!forum/ggplot2 |
| 77 | +[so]: http://stackoverflow.com/questions/tagged/ggplot2?sort=frequent&pageSize=50 |
| 78 | +[cookbook]: http://amzn.to/2dVfMfn |
| 79 | +[r4ds]: http://r4ds.had.co.nz |
| 80 | +[r4ds-vis]: http://r4ds.had.co.nz/data-visualisation.html |
| 81 | +[r4ds-comm]: http://r4ds.had.co.nz/graphics-for-communication.html |
| 82 | +[datacamp]: https://www.datacamp.com/courses/data-visualization-with-ggplot2-1 |
0 commit comments