Enter your name and EID here
This homework is due on Feb. 15, 2021 at 11:00pm. Please submit as a pdf file on Canvas.
Problem 1: (5 pts) We will work with the
midwest dataset provided by ggplot2. See here for details: https://ggplot2.tidyverse.org/reference/midwest.html
For the following plot, add an appropriate color scale from the colorspace package and explicitly set the palette you want to use. Also add an appropriate theme that works well with the color scale you have chosen. Explain in 2-3 sentences your choice of color scale and theme.
ggplot(midwest, aes(popdensity, percollege, fill = state)) + geom_point(shape = 21, size = 2.5, color = "white", stroke = 0.5) + scale_x_log10(name = "population density") + scale_y_continuous(name = "percent college educated") + NULL # replace NULL with your color scale and theme code
Provide your explanation here.
Problem 2: (2 pts) The following is a plot of the
diamonds dataset provided by ggplot2. See here for details: https://ggplot2.tidyverse.org/reference/diamonds.html
ggplot(diamonds, aes(carat, price, color = cut)) + geom_point()