Getting started

To profit best from this course, you need to install both R and R Studio on your computer

Session 1: Overview


  • Getting started: R, R Studio
  • The roles of graphics in data analysis (exploration, analysis, presentation)
  • What can I do with R graphics: Anything!
  • R graphics systems: base graphics; grid graphics; ggplot2
  • Reproducible analysis and reporting with knitr and R markdown with R Studio

Session 2: Standard graphics in R


  • R has a simple, object-oriented design that facilitates data analysis and plots.
  • Much of what you need or want to do can be done with this, by simply using plot(object).
  • Tweaking graphs: Learn to control the details of R graphs by controling the graphic parameters: color, point symbols, line styles and so forth.
  • Annotating graphs: Graphs for different purposes can be enhanced by adding features, such as fitted lines, confidence envelopes, data ellipses, or text

Session 3: Grid and lattice graphics


  • The grid graphics system for R provides an alternative and more powerful means to construct data graphics in R.
  • The lattice package provides functions for drawing all standard plots (scatterplots, histograms, density plots, etc.), usually with more pleasing default results, but more importantly, allows you to compose collections (“small multiples”) of simpler graphs from structured subsets of the data.
  • The vcd package uses grid graphics to produce a wide variety of plots for categorical data (mosaic plots, spine plots, sieve diagrams, etc.)

Session 4: ggplot2


  • ggplot2 takes a totally different, but arguably most powerful, approach to the construction of statistical graphs, based on the “Grammar of Graphics”.
  • The graphic language of ggplot2 makes it easier to think of a graph as composed of layers (points, lines, regions), each of which is rendered with various graphical attributes.
  • ggplot2 is part of a workflow for “tidy” data manipulation and graphics that is well worth learning.