Exploring temperature data
Now that you've learned a bit about your flights
data - and reviewed the basics of time series data manipulation - your next assignment is to explore weather patterns in the Boston area to understand what might be affecting flight delays and cancellations. To do this, you'll need to compile and manipulate some additional time series data.
In this exercise, you'll explore some temperature data in the Boston area, including measures of min, mean, and max daily temperature over time. These data were collected using the weatherData package in R, which scrapes publicly available data from Weather Underground.
Before moving forward with your time series data manipulation, the first step in any data analysis is to examine the basic qualities of your data. Specifically, you'll take a closer look at two temperature data objects (temps_1
and temps_2
) to understand what information these objects contain and how you should proceed.
This exercise is part of the course
Case Study: Analyzing City Time Series Data in R
Exercise instructions
- Use two calls of
str()
to view the structure of each temperature object:temps_1
andtemps_2
. Pay close attention to the output! - View the first and last few rows of
temps_1
usinghead()
andtail()
. - View the first and last few rows of
temps_2
usinghead()
andtail()
. Do these two objects contain similar data?
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# View the structure of each object
str(___)
str(___)
# View the first and last rows of temps_1
head(___)
tail(___)
# View the first and last rows of temps_2