Let us create scatterplots and change the shape and size of points, the colors, and the transparency of points. Follow the steps given below:
- To make these scatterplots more visually appealing, load dplyr and remove the two observations with a bodywt greater than 2000, creating the msleep2 dataset, as follows:
library(dplyr) msleep2 <- msleep %>% filter(bodywt < 2000)
- Now, create a scatterplot of bodywt versus brainwt, using triangles for the points. You will see an error in your console window saying that it removed rows with missing values. Don't worry about this for now; missing data isn't the focus of this exercise.
ggplot(msleep2, aes(brainwt, ...