Start by loading the dplyr and ggplot2 library as well as the murders data.

library(dplyr)
library(ggplot2)
library(dslabs)
data(murders)

The geom_point layer has many more aesthetics apart from the required x and y aesthetics.

Exercise

Complete the following 3 tasks by setting or mapping one extra geom_point aesthetic to the given example:

murders %>% ggplot() +
    geom_point(aes(x=population/10^6, y=total))
  1. Edit the example by adding the size aesthetic to give all points a size of 5 (size=5). Store your result in p1.

  2. Edit the example by adding the alpha aesthetic to give all points an alpha value of 0.3 (alpha=0.3). Store your result in p2.

  3. Edit the example by adding the shape aesthetic to give every point a shape according to its region (shape=region). Your solution should also automatically generate a legend for the shapes. Store your result in p3.