Show the code
# data source: https://www.transtats.bts.gov/Data_Elements.aspx?Data=1
<- read_csv("data/spirit_passengers_5_2_2024.csv",
spirit show_col_types = F, skip=1)|>
filter(Month != "TOTAL") |>
mutate(date_som = ym(paste(Year, Month)),
Date = ceiling_date(date_som, "month")-1,
Total = (TOTAL/1000000) |> round(2)) |>
select(Date, Total) |>
glimpse(width=60)
Rows: 256
Columns: 2
$ Date <date> 2002-10-31, 2002-11-30, 2002-12-31, 2003-01…
$ Total <dbl> 0.30, 0.33, 0.36, 0.34, 0.31, 0.36, 0.35, 0.…
Show the code
<- spirit |> # post_pandemic data
spirit_pp filter(Date >= "2021-06-01") |>
glimpse(width=60)
Rows: 32
Columns: 2
$ Date <date> 2021-06-30, 2021-07-31, 2021-08-31, 2021-09…
$ Total <dbl> 2.92, 3.39, 2.43, 2.47, 2.72, 2.92, 3.00, 2.…