Flight data
Now that you're back in the time series mindset, it's time to get to work! Your task is to understand the travel patterns of tourists visiting Boston. As a first step, you've been assigned to explore patterns in flights arriving at Boston's Logan International Airport (BOS). In this exercise, you'll view the structure and qualities of some data in preparation for time series manipulation.
Lucky for you, the U.S. Bureau of Transportation Statistics provides open source data on flight arrival times. The flights
data file has been preloaded in your workspace.
This course touches on a lot of concepts you may have forgotten, so if you ever need a quick refresher, download the xts in R Cheat Sheet and keep it handy!
This exercise is part of the course
Case Study: Analyzing City Time Series Data in R
Exercise instructions
- Explore the structure of
flights
using str() to understand the information contained in the data file. - View the first
5
rows offlights
usinghead()
to get a feel for what the data look like. - The first step in preparing an object for conversion to
xts
is to ensure that the time/date column is in a proper time-based format. Check the class of the relevant column inflights
usingclass()
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
#View the structure of the flights data
#Examine the first five rows of the flights data
head(___, n = ___)
#Identify class of the column containing date information
class(___)