If instead of points we want to add text, we can use the geom_text() or geom_label() geometries. The following code

murders %>% ggplot(aes(population, total)) + geom_label()

will give us the error message: Error: geom_label requires the following missing aesthetics: label. This is because we need to specify which labels it should print throug the label aestethic mapping.

1. Rewrite the code above to use abbreviation as the label through aes. Save the resulting ggplot object in p_abb.

2. If we wanted to change the color of the labels to blue, how would we do that?

  1. Adding a column called blue to murders.
  2. Because each label needs a different color we map the colors through aes.
  3. Use the color argument in ggplot.
  4. Because we want all colors to be blue, we do not need to map colors, just use the color argument in geom_label.

Save your answer in question_2

3. Rewrite the code above to make the labels blue. Save the resulting ggplot object in p_abb_blue