Session Ready
Exercise

Visualizing Boston winters

You discovered in the previous chapter that a much higher percentage of flights are delayed or cancelled in Boston during the winter. It seems logical that temperature is an important factor here. Perhaps colder temperatures are associated with a higher percentage of flight delays or cancellations?

In this exercise, you'll probe the plausibility of this hypothesis by plotting temperature trends over time and generating a visual overview of Boston winters.

Instructions
100 XP
  • Before plotting, check the periodicity and duration of your data using periodicity(). Knowing the periodicity will help you interpret your data and will come in handy as you proceed.
  • Use plot.xts() to generate a plot of mean Boston temperature (temps_xts$mean) for the duration of your data.
  • Generate another plot of mean Boston temperature from November 2010 through April 2011 (inclusive).
  • Use plot.zoo() to replicate your last plot while including the other columns in your data (in this case, min and max temperature). Specify plot.type as "single" to include all three lines on the same panel. Do not change the prewritten lty argument.