Activity: Using Faceting to Understand Data

Scenario

Here you want to look at the distribution of loan amounts for different credit grades.

Aim

To plot the loan amount for different credit grades using faceting.

Steps for Completion

  1. Use the loan data and plot a histogram.
  2. Use the required command to plot the loan data.
  3. Change the default options for facet_wrap.

Outcome

Take a look at the following outcome plots, plot 1:

Plot 2:

Get Applied Data Visualization with R and ggplot2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.