• ggplot2 with R Book Club
  • Welcome
    • Book club meetings
    • Pace
    • Introductions
    • git and GitHub
    • Group Question 1
    • Group Question 2
    • Group Question 3
    • git and GitHub Resources
    • Learning objectives
  • Getting Started
  • 1 Introduction
    • Hi, my name is…
    • Present a chapter!
    • Remember #TidyTuesday
    • Welcome to ggplot2
    • Grammar of graphics
    • Mapping components
    • About this book
    • Prerequisites
    • Meeting Videos
      • 1.0.1 Cohort 1
  • 2 First Steps
    • 2.1 General Housekeeping Items
    • 2.2 Learning Objectives
    • 2.3 Introduction
    • 2.4 Main data set
    • 2.5 Components of every plot
    • 2.6 Other aesthetic attributes
    • 2.7 Faceting
    • 2.8 Geoms
    • 2.9 Modifying the Axes
    • 2.10 Output
    • 2.11 Meeting Videos
      • 2.11.1 Cohort 1
  • Layers
  • 3 Individual Geoms
    • 3.1 The basics
    • 3.2 Area chart: geom_area()
    • 3.3 Bar chart: geom_bar()
    • 3.4 Line chart: geom_line()
    • 3.5 Scatterplot: geom_point()
    • 3.6 Polygons: geom_polygon()
    • 3.7 Histograms: geom_histogram()
    • 3.8 Drawing rectangles: geom_rect(); geom_tile(); geom_raster()
    • 3.9 Add text to a plot: geom_text()
    • 3.10 Exercise solutions
      • 3.10.1 Exercise 1
      • 3.10.2 Exercise 2
      • 3.10.3 Exercise 3
    • 3.11 Meeting Videos
      • 3.11.1 Cohort 1
  • 4 Collective Geoms
    • 4.1 General Housekeeping Items
    • 4.2 Learning Objectives
    • 4.3 Quick Intuition on Collective Geoms
    • 4.4 From the ggplot2 book
      • 4.4.1 Multiple Groups, One Aesthetic
      • 4.4.2 Different Groups on Different Layers
      • 4.4.3 Overriding the Default Grouping
      • 4.4.4 A couple of exercises
      • 4.4.5 Matching Aesthetics to Graphic Objects
    • 4.5 Meeting Videos
      • 4.5.1 Cohort 1
  • 5 Statistical Summaries
    • 5.1 Defintions (in this Chapter)
    • 5.2 Revealing Uncertainty
    • 5.3 Weighted Data
    • 5.4 Displaying distributions
      • 5.4.1 Exercise:
    • 5.5 Dealing with overplotting
    • 5.6 Statistical Summaries
    • 5.7 Meeting Videos
      • 5.7.1 Cohort 1
  • 6 Maps
    • 6.1 Polygon Maps
    • 6.2 Simple Features Maps
      • 6.2.1 Layered Maps
      • 6.2.2 Labelled Maps
      • 6.2.3 Adding Other Geoms
    • 6.3 Map Projections
    • 6.4 Working with sf Data
    • 6.5 Raster Maps
    • 6.6 Data Sources
    • 6.7 Meeting Videos
      • 6.7.1 Cohort 1
  • 7 Networks
    • Introduction
    • What is network data?
    • Network data is special
    • {tidygraph}: A tidy network manipulation API
    • Example: creating a graph
      • Conversion to tbl_graph
    • Example: colors
    • Algorithms
    • Visualizing networks
    • Setting up the visualization
    • Specifying a layout
    • Many possible layouts
    • More on {igraph}
    • Circular layouts
    • Drawing nodes
    • Color nodes by centrality
    • Making tiles
    • Drawing edges
    • Interpolating edge colors
    • Other types of edges
    • Trees and specifically dendrograms:
    • Clipping edges around nodes
    • An edge is not always a line
    • Faceting
    • Conclusions
    • Resources
    • 7.1 Meeting Videos
      • 7.1.1 Cohort 1
  • 8 Annotations
    • 8.1 Introduction
    • 8.2 Plot and Axis Titles
    • 8.3 Text labels
    • 8.4 Annotations
    • 8.5 Directlabels Package
    • 8.6 Faceting Annotations
    • 8.7 Resources
    • 8.8 Meeting Videos
      • 8.8.1 Cohort 1
  • 9 Arranging Plots
    • Introduction
    • Arranging plots side by side with no overlap
    • Controlling the layout
    • More compositions:
    • Layouts can get creative!
    • Collect repeats of the same legend
    • Parts of the patchwork object can still be modified
    • New operator: & adds whole-plot themes
      • Plot annotations
    • Labeling plots (e.g. parts of figures)
    • Specify the type of tags/labels
    • Arranging plots on top of each other
    • Example:
    • Another inset example with annotation
    • Extra
    • Conclusions
      • Extra resources:
    • Meeting Videos
      • Cohort 1
  • Scales
  • 10 Position scales and axes
    • Preliminaries / asides
    • Introduction
    • Themes to discuss
    • Numeric position scales
    • Numeric position scales: Limits
    • Zooming in
    • Visual range expansion
    • Breaks
    • Minor breaks
    • Labels
    • Transformations
    • Date-time
    • Breaks
    • Labels
    • Discrete position scales
    • Limits, breaks, labels
    • ASIDE - geom_sf() + limits
      • Example from Twitter:
      • Reprexes from Ryan S:
      • Further exploration
      • Internals
    • Meeting Videos
      • 10.0.1 Cohort 1
  • 11 Colour Scales and Legends
    • 11.1 A little colour theory
      • 11.1.1 Colour blindness
    • 11.2 Continuous colour scales
      • 11.2.1 Particular pallettes
      • 11.2.2 Robust recipes
      • 11.2.3 Missing values
      • 11.2.4 Limits, breaks and labels
      • 11.2.5 Legends
    • 11.3 Discrete colour scales
      • 11.3.1 Brewer scales
      • 11.3.2 Hue and grey scales
      • 11.3.3 Paleteer Scales
      • 11.3.4 Manual scales
      • 11.3.5 Limits, breaks and labels
      • 11.3.6 Legends
    • 11.4 Binned colour scales
      • 11.4.1 Limits, breaks and labels
      • 11.4.2 Legends
    • 11.5 Date Time Colour Scales
    • 11.6 Alpha scales
    • 11.7 Legend position
    • 11.8 Meeting Videos
      • 11.8.1 Cohort 1
  • 12 Other Aesthetics
    • 12.1 Size
      • 12.1.1 Radius size scales
      • 12.1.2 Binned size scales
    • 12.2 Shape
    • 12.3 Line type
    • 12.4 Manual scales
    • 12.5 Identity Scales
    • 12.6 Meeting Videos
      • 12.6.1 Cohort 1
  • The Grammar
  • 13 Build a plot layer by layer
    • 13.1 Building a plot
    • 13.2 Data
      • 13.2.1 Exercises
    • 13.3 Aesthetic mappings
      • 13.3.1 Specifying the aesthetics in the plot vs. in the layers
      • 13.3.2 Setting vs. mapping
    • 13.4 Geoms
      • 13.4.1 Exercises
    • 13.5 Stats
      • 13.5.1 Generated variables from the stat_...() functions
      • 13.5.2 Exercises
    • 13.6 Position adjustments
    • 13.7 Meeting Videos
      • 13.7.1 Cohort 1
  • 14 Scales and Guides
    • 14.1 Theory of scales and guides
      • 14.1.1 Scale specification
      • 14.1.2 Naming scheme
      • 14.1.3 Fundamental scale types
    • 14.2 Scale Breaks
    • 14.3 Scale Limits
    • 14.4 Scale guides
    • 14.5 Scale transformation
    • 14.6 Legend merging and splitting
      • 14.6.1 Merging legends
      • 14.6.2 Splitting legends
    • 14.7 Legend key glyphs
    • 14.8 Meeting Videos
      • 14.8.1 Cohort 1
  • 15 Coordinate systems
    • 15.1 Introduction
    • 15.2 Linear coordinate systems
    • 15.3 Non-linear coordinate systems
      • 15.3.1 Example: Coord_polar() with DuBoisChallenge N°8 data
    • 15.4 Meeting Videos
      • 15.4.1 Cohort 1
  • 16 Faceting
    • 16.1 What is faceting?
    • 16.2 Facet wrap
    • 16.3 Facet grid
    • 16.4 Controlling scales
    • 16.5 Controlling space
    • 16.6 Missing faceting variables
    • 16.7 Grouping vs. faceting
    • 16.8 Continuous variables
    • 16.9 Meeting Videos
      • 16.9.1 Cohort 1
  • 17 Themes
    • 17.1 Theme
      • 17.1.1 Complete themes
    • 17.2 Plot elements of a theme
    • 17.3 Meeting Videos
      • 17.3.1 Cohort 1
  • Advanced Topics
  • 18 Programming with ggplot2
    • Why program with {ggplot2}?
      • Plot components are objects!
    • Adding the object we created to a plot
    • Creating a function
    • ... gives functions flexibility
    • Exercises
    • 18.1 A ggplot object is a list!
    • Components of a plot
    • We can add any of these to a plot and override existing
    • What if the dataset doesn’t have the same variables?
    • Annotations
    • Additional arguments
    • Making the complete plot–very limited flexibility
    • What if we want to pass in different variables?
    • References
    • 18.2 Meeting Videos
      • 18.2.1 Cohort 1
  • 19 Internals of ggplot2
    • 19.1 Introduction (the existence of internals)
    • 19.2 Case 1: Order
    • 19.3 Case 2: Modularity
    • 19.4 The plot() method
      • 19.4.1 ggplot structure
      • 19.4.2 Display
    • 19.5 Steps
    • 19.6 The build step
      • 19.6.1 Data preparation
      • 19.6.2 Data transformation
      • 19.6.3 Output
      • 19.6.4 Explore
    • 19.7 The gtable step
    • 19.8 Rendering the panels
    • 19.9 Adding guides
    • 19.10 Adding adornment
      • 19.10.1 Output
    • 19.11 Introducing ggproto
      • 19.11.1 ggproto syntax
      • 19.11.2 ggproto style guide
    • 19.12 Meeting Videos
      • 19.12.1 Cohort 1
  • 20 Extending ggplot2
    • 20.1 Overview
    • 20.2 Themes
    • 20.3 Stats
    • 20.4 Geoms
    • 20.5 Coords
    • 20.6 Scales
    • 20.7 Other important parts
      • 20.7.1 Positions
      • 20.7.2 Facets
      • 20.7.3 Guides
    • 20.8 References
    • 20.9 Meeting Videos
      • 20.9.1 Cohort 1
  • 21 A case study
    • 21.1 {Slide 1 title}
    • 21.2 Meeting Videos
      • 21.2.1 Cohort 1
  • 22 Mastering the Grammar
    • 22.1 Introduction
    • 22.2 Building a scatterplot
    • 22.3 Scaling
    • 22.4 Adding complexity; faceting, coordinates, hierarchy of defaults
    • 22.5 Process and Examples
    • 22.6 Meeting Videos
      • 22.6.1 Cohort 1
  • Published with bookdown

ggplot2 Book Club

git and GitHub Resources

  • Happy Git and GitHub for the useR
  • usethis’s pull request helpers
  • git’s documentation
  • MShiny Cohort 2 Introduction