Plotting x-y data: time series

Author

Jeffrey R. Stevens

Published

April 18, 2025

  1. Using the mpg data, calculate the mean highway fuel efficiency for each number of cylinders and plot a line graph of fuel efficiency by cylinder number.
# >
  1. Make the same plot but instead of calculating the values in advance, use stat_summary() to calculate the means inside the plot.
# >
  1. Repeat plot #1 but also group by class and plot separately colored lines for different classes.
# >
  1. Create a new column called low_high that codes high fuel efficiency greater than or equal to 25 as 1 and less than 25 as 0. Plot low_high as a function of displacement with a bubble chart (no legend) and include a logistic regression curve and band.
# >
  1. Plot highway fuel efficiency for each class as points first, then add jitter, finding an appropriate amount of jitter to add.
# >
  1. Repeat plot #5 with a beeswarm plot.
# >