R Data Visualization
r
visualization
ggplot2
graphics
highcharts
Tutorials, color tools, ggplot2 extensions, and interactive chart and map packages for visualizing data in R.
This guide collects tutorials, examples, and packages for drawing charts and maps in R. Begin with the three picks under Start here, then browse the ggplot2 tutorials, color tools, and package tables as your project needs them. QGIS tutorials, data, and tools for mapping are on the GIS page.
Start here
- The best R packages for data visualization — R Graph Gallery overview of recommended R packages for making charts.
- Graphs, Cookbook for R — Recipes for making common graphs in R, from the Cookbook for R site.
- Getting Started with Charts in R — FlowingData introduction to making charts in R, from 2012.
ggplot2 and chart design
- An Introduction on How to Make Beautiful Charts With R and ggplot2 — 2015 tutorial on making polished charts with ggplot2.
- Beautiful plotting in R: A ggplot2 cheatsheet — 2014 blog post of ggplot2 examples, linked at its default-plot section.
- ggplot2 cheatsheet (PDF) — Posit’s official ggplot2 data visualization cheatsheet as a PDF.
- Lattice graphics, STAT 545A — Course notes on the lattice graphics package from the University of British Columbia.
- R: How to Layout and Design an Infographic — Blog post on laying out and designing an infographic in R.
- Tufte style visualizations in R using Plotly — R-Bloggers post on recreating Tufte-style visualizations with Plotly.
- Supreme Annotations — rud.is blog post on annotating charts in R.
Worked examples
- Visualizing the Clinton Emails — rud.is project that visualizes the Clinton emails with R.
- What Happened on the Germanwings Flight — Data-journalism post about the Germanwings flight, listed here as an R example.
- R to JavaScript, Peter Aldhous (NICAR 2017) — Session notes on moving results from R into JavaScript charts.
- Pretty street maps in R with the osmdata package and ggplot — Tutorial on drawing street maps with osmdata and ggplot (archived copy).
Color
- How to use Color Palettes for your Data Visualization — Tutorial on choosing color palettes for charts, with ggplot2 examples.
- RColorBrewer — Package providing the ColorBrewer color schemes designed by Cynthia Brewer.
ggplot2 extensions and plot helpers
| Package | What it does |
|---|---|
| ggblanket | Aims to simplify making ggplot2 charts |
| ggdist | Draws distributions and uncertainty in ggplot2 |
| ggbump | Adds a geom for bump plots to ggplot2 |
| legendry | Extends ggplot2 with more kinds of legends and axis guides |
| ggstatsplot | Adds statistical test results to ggplot2 plots |
| gghighlight | Highlights chosen points or lines in a ggplot2 chart |
| visdat | Quick exploratory plots of a dataset’s structure |
| venneuler | Draws Venn and Euler diagrams |
Interactive charts and maps
| Package | What it does |
|---|---|
| plotly | Builds interactive charts from R |
| highcharter | R wrapper for the Highcharts JavaScript library |
| rCharts | Builds interactive JavaScript charts from R |
| heatbarWithRHighcharts | Example of an interactive heatmap and bar chart made with R and Highcharts |
| GWalkR | Opens a data frame in a drag-and-drop chart builder |
| ggmap | Plots maps in R with ggplot2 |
| leaflet | Documentation for the leaflet package for interactive maps |
| globe4r | Draws interactive globe visualizations |