Activity: Using Color Differentiation in Plots

Steps for Completion:

  1. Use the LoanStats dataset and make a subset using the following variables:
dfn <- df3[,c("home_ownership","loan_amnt","grade")]
  1. Clean the dataset (removing the NONE and NA cases), using the following code:
dfn <- na.omit(dfn)dfn <- subset (dfn, !dfn$home_ownership %in% c("NONE"))
  1. Create a boxplot showing the loan amount versus home ownership.
  2. Color differentiate by credit grade.

Outcome:

Refer to the following URL for the output: https://goo.gl/RheL2G.

The answers to question 5 are as follows:

  1. Credit grades F and G are the highest. Credit grades A and B are the lowest.
  2. They are higher for a person who has a mortgage.
  3. The median value for A is 2,000, and the median ...

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.