Exercise

Add facets to the plot

Here, you'll leverage facet_grid() to add horizontal facets for 1996 and 2006 each, as detailed in the video.

When using facet_grid(), it is good practice to specify the arrangement of plots with a named argument: rows = ... or cols = .... This helps to avoid confusion since the facet_grid() function takes many other arguments.

Instructions

100 XP
  • Use facet_grid() with the right argument to generate two separate scatter plots that are arranged horizontally.
  • The left plot should show the data for the year 1996 while the year 2006 should be shown on the right side.