CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Case Study: Analyzing City Time Series Data in R

Afficher le cours

Instructions

  • 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.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Identify the periodicity of flights_xts


# Identify the number of periods in flights_xts


# Find data on flights arriving in BOS in June 2014
Modifier et exécuter le code