1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Visualization with ggplot2

Connected

Exercise

Overplotting 4: Integer data

Let's take a look at the last case of dealing with overplotting:

  1. Integer data

This can be type integer (i.e. 1 ,2, 3…) or categorical (i.e. class factor) variables. factor is just a special class of type integer.

You'll typically have a small, defined number of intersections between two variables, which is similar to case 3, but you may miss it if you don't realize that integer and factor data are the same as low precision data.

The Vocab dataset provided contains the years of education and vocabulary test scores from respondents to US General Social Surveys from 1972-2004.

Instructions 1/4

undefined XP
  • 1
    • Examine the Vocab dataset using str().
    • Using Vocab, draw a plot of vocabulary vs education.
    • Add a point layer.
  • 2
    • Replace the point layer with a jitter layer.
  • 3
    • Set the jitter transparency to 0.2.
  • 4
    • Set the shape of the jittered points to hollow circles, (shape 1).