Analizlerde Wickham (2021) tarafından geliştirilen nycflights13 veri seti kullanılmıştır. Veri seti, 2013 yılında New York’tan yapılan uçuşlara ilişkin bilgileri içermektedir. Veride her uçuşa ait tarih, kalkış ve varış saatleri, planlanan zamanlar, gecikme süreleri, mesafe, uçuş süresi, havayolu bilgisi ve uçak numarası gibi değişkenler yer almaktadır.
🎵 New York uçuşları verisi için şarkı önerisidir🎵
(Bağlantı yeni sekmede aç yapıldığında çalışmaktadır.)
## [1] 336776 19
## Rows: 336,776
## Columns: 19
## $ year <int> 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2…
## $ month <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ day <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…
## $ dep_time <int> 517, 533, 542, 544, 554, 554, 555, 557, 557, 558, 558, …
## $ sched_dep_time <int> 515, 529, 540, 545, 600, 558, 600, 600, 600, 600, 600, …
## $ dep_delay <dbl> 2, 4, 2, -1, -6, -4, -5, -3, -3, -2, -2, -2, -2, -2, -1…
## $ arr_time <int> 830, 850, 923, 1004, 812, 740, 913, 709, 838, 753, 849,…
## $ sched_arr_time <int> 819, 830, 850, 1022, 837, 728, 854, 723, 846, 745, 851,…
## $ arr_delay <dbl> 11, 20, 33, -18, -25, 12, 19, -14, -8, 8, -2, -3, 7, -1…
## $ carrier <chr> "UA", "UA", "AA", "B6", "DL", "UA", "B6", "EV", "B6", "…
## $ flight <int> 1545, 1714, 1141, 725, 461, 1696, 507, 5708, 79, 301, 4…
## $ tailnum <chr> "N14228", "N24211", "N619AA", "N804JB", "N668DN", "N394…
## $ origin <chr> "EWR", "LGA", "JFK", "JFK", "LGA", "EWR", "EWR", "LGA",…
## $ dest <chr> "IAH", "IAH", "MIA", "BQN", "ATL", "ORD", "FLL", "IAD",…
## $ air_time <dbl> 227, 227, 160, 183, 116, 150, 158, 53, 140, 138, 149, 1…
## $ distance <dbl> 1400, 1416, 1089, 1576, 762, 719, 1065, 229, 944, 733, …
## $ hour <dbl> 5, 5, 5, 5, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 6…
## $ minute <dbl> 15, 29, 40, 45, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0…
## $ time_hour <dttm> 2013-01-01 05:00:00, 2013-01-01 05:00:00, 2013-01-01 0…
## year month day dep_time sched_dep_time
## 0 0 0 8255 0
## dep_delay arr_time sched_arr_time arr_delay carrier
## 8255 8713 0 9430 0
## flight tailnum origin dest air_time
## 0 2512 0 0 9430
## distance hour minute time_hour
## 0 0 0 0
ucuslar <- flights %>%
rename(yil = year,
ay = month,
gun = day,
kalkissaat = dep_time,
planlanankalkis = sched_dep_time,
kalkisgecikmesi = dep_delay,
varissaat = arr_time,
planlananvaris = sched_arr_time,
varisgecikmesi = arr_delay,
havayolu = carrier,
ucusno = flight,
kuyrukno = tailnum,
kalkishavalimani = origin,
varishavalimani = dest,
ucussuresi = air_time,
mesafe = distance,
saat = hour,
dakika = minute)## [1] 327346 19
## Rows: 327,346
## Columns: 19
## $ yil <int> 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013, 2013,…
## $ ay <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ gun <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ kalkissaat <int> 517, 533, 542, 544, 554, 554, 555, 557, 557, 558, 558…
## $ planlanankalkis <int> 515, 529, 540, 545, 600, 558, 600, 600, 600, 600, 600…
## $ kalkisgecikmesi <dbl> 2, 4, 2, -1, -6, -4, -5, -3, -3, -2, -2, -2, -2, -2, …
## $ varissaat <int> 830, 850, 923, 1004, 812, 740, 913, 709, 838, 753, 84…
## $ planlananvaris <int> 819, 830, 850, 1022, 837, 728, 854, 723, 846, 745, 85…
## $ varisgecikmesi <dbl> 11, 20, 33, -18, -25, 12, 19, -14, -8, 8, -2, -3, 7, …
## $ havayolu <chr> "UA", "UA", "AA", "B6", "DL", "UA", "B6", "EV", "B6",…
## $ ucusno <int> 1545, 1714, 1141, 725, 461, 1696, 507, 5708, 79, 301,…
## $ kuyrukno <chr> "N14228", "N24211", "N619AA", "N804JB", "N668DN", "N3…
## $ kalkishavalimani <chr> "EWR", "LGA", "JFK", "JFK", "LGA", "EWR", "EWR", "LGA…
## $ varishavalimani <chr> "IAH", "IAH", "MIA", "BQN", "ATL", "ORD", "FLL", "IAD…
## $ ucussuresi <dbl> 227, 227, 160, 183, 116, 150, 158, 53, 140, 138, 149,…
## $ mesafe <dbl> 1400, 1416, 1089, 1576, 762, 719, 1065, 229, 944, 733…
## $ saat <dbl> 5, 5, 5, 5, 6, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6,…
## $ dakika <dbl> 15, 29, 40, 45, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59,…
## $ time_hour <dttm> 2013-01-01 05:00:00, 2013-01-01 05:00:00, 2013-01-01…
ggplot(ucuslar_temiz, aes(x = mesafe, y = ucussuresi, color = mesafe)) +
geom_point() +
geom_smooth() +
labs(title = "Mesafe ile Ucus suresi iliskisi",
x = "Mesafe", y = "Ucus suresi") +
theme_minimal()## `geom_smooth()` using method = 'gam' and formula = 'y ~ s(x, bs = "cs")'
## Warning: The following aesthetics were dropped during statistical transformation:
## colour.
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
## the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
## variable into a factor?
Mesafe arttikca ucus suresi artmaktadır.
ggplot(ucuslar_temiz, aes(x = havayolu)) +
geom_bar(fill = "steelblue") +
geom_vline(xintercept = 12, color = "red", linetype = "dashed") +
labs(title = "Havayollarina gore ucus sayisi",
x = "Havayolu", y = "Ucus sayisi") +
theme_light()En fazla ucus yapan havayolu UA, an az ucus yapan HA’dır.
ggplot(ucuslar_temiz, aes(x = havayolu, y = varisgecikmesi, fill = havayolu)) +
geom_boxplot(show.legend = FALSE) +
facet_wrap(~ kalkishavalimani, nrow =3) +
labs(title = "Havayollarina gore varis gecikmeleri",
x = "Havayolu", y = "Varis gecikmesi") +
theme_bw()Çoğu uçuş aslında zamanında gerçekleşiyor (yani gecikmeler genelde çok az), ama yine de tüm havalimanlarında bazen çok uzun gecikmeler yaşanabiliyor. Özellikle DL ve AA gibi büyük havayolları, üç havalimanında da hem en fazla uçuşa hem de en yüksek gecikmelere sahip. HA ise tek başına en uzun gecikmeleri yapma eğiliminde. Bu durum, New York’tan kalkan uçuşlarda bazen çok büyük ve nadir gecikmelerin hâlâ önemli bir sorun olduğunu gösteriyor.
ggplot(ucuslar_temiz, aes(x = kalkisgecikmesi)) +
geom_histogram() +
labs(title = "Kalkis gecikmelerinin dagilimi",
x = "Kalkis gecikmesi (dk)", y = "Ucus sayisi")## `stat_bin()` using `bins = 30`. Pick better value `binwidth`.
Cogu ucus zamaninda veya kucuk gecikmelerle kalkiyor; cok gecikmeler nadir.
agustos_ucuslar <- ucuslar_temiz %>%
filter(ay == 8) %>%
group_by(gun) %>%
summarise(ucus_sayisi = n())
ggplot(agustos_ucuslar, aes(x = gun, y = ucus_sayisi)) +
geom_line(color = "steelblue") +
geom_point(color = "darkblue") +
labs(title = "Agustos ayi gunluk ucus sayisi",
x = "Gun", y = "Ucus sayisi") +
theme_classic()5 agustos en fazla ucusun oldugu, 31 agustos en az ucusun oldugu gundur.