1. Learn
  2. /
  3. Courses
  4. /
  5. Case Study: Analyzing City Time Series Data in R

Exercise

Exploring your flight data

Before any analysis can be done, it is critical to explore the basic qualities of your data, including periodicity, scope, and comprehensiveness.

In this exercise, you'll gain a better understanding of your data by exploring these qualities. As you may recall from the earlier exercises, your time index seemed to be in months. To check that this is constant throughout your xts object, you can use the periodicity() command to tell you the periodicity and scope of the data.

Once you are sure of periodicity, you may also want to know how many periods are covered. To identify the number of periods in your data, you can use the ndays() command, or one of its wrappers, nmonths(), nyears(), etc.

Finally, you may find it useful to query for a particular date by subsetting For example, inputting xts_object["date"] will generate the row pertaining to that date.

Instructions

100 XP
  • Identify the periodicity and scope of your flights_xts object using periodicity().
  • Identify the number of periods in your data using the most relevant command.
  • Query your data for information on flights arriving in BOS in June 2014.