Grammar of graphics I

Author

Jeffrey R. Stevens

Published

March 31, 2023

  1. Using the mtcars data, create a scatterplot of the fuel efficiency as a function of weight.
# >
  1. Repeat the plot but only with vehicles having 4 or 6 cylinders.
# >
  1. Repeat plot #1 but add a smooth line underneath the data points.
# >
  1. Make a boxplot of fuel efficiency for each cylinder size.
# >
  1. Add ” cylinders” to the end of each value in the cylinder column of data and replot #4.
# >
  1. Replot #4 ordering the cylinders such that the median mpg increases from left to right.
# >