MTH-391A | Spring 2025 | University of Portland
March 14, 2025
Date/Time Ambiguity and Formats
Example Dates
## [1] "2017-01-31"
## [1] "2017-01-31"
## [1] "2017-01-31"
Converting String Dates into date/time format
Time Granularity and Time-Zones
New York City Flights
nycflights13
package: On-time data for all flights
that departed NYC (i.e. JFK, LGA or EWR) in 2013nycflights23
package: Similar to
nycflights13
but in 2023Each row in the flights
tibble is a unique flight from
NYC.
date_time
| date and time of departure, which can be
decomposed into parts (year
, month
,
day
, hour
)carrier
| type of airlineorigin
| origin airport in New York (JFK, LGA or
EWR)dest
| destination airport (e.g. ATL, LAX, PDX)dep_delay
| Departure delays, in minutes. Negative
times represent early departures/arrivals.## # A tibble: 3 × 9
## date_time carrier origin dest dep_delay year month day hour
## <dttm> <chr> <chr> <chr> <dbl> <int> <int> <int> <dbl>
## 1 2013-11-07 06:00:00 WN LGA ATL 0 2013 11 7 6
## 2 2013-10-30 12:00:00 AA JFK BOS 2 2013 10 30 12
## 3 2023-08-24 21:00:00 9E LGA PWM 34 2023 8 24 21
The main goal of time-series data is to analyze how a variable or set of variables evolve over time. This typically involves identifying patterns and trends.
How many flights occurred in 2013 and 2023?
What is the number of fights per month?
What is median departure delay per month coming out of each NYC airport?
What is the median daily delay during the summer months?
Effective Methods for Analyzing Trends Over Time
.Rmd
file by replacing [name]
with your name
using the format [First name][Last initial]
. Then, open the
.Rmd
file.