Skip to content

Commit 10dd11a

Browse files
authored
Merge pull request #6 from RamiKrispin/data-refresh-03/22
V0.1.2
2 parents f85b2e0 + a1dd149 commit 10dd11a

File tree

107 files changed

+137343
-18993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+137343
-18993
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
^vignettes/v2_analyzing_sfo.Rmd$
1414
^CRAN-RELEASE$
1515
^man/figures/sfo.png$
16+
^CRAN-SUBMISSION$

CRAN-SUBMISSION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Version: 0.1.2
2+
Date: 2023-03-16 17:25:58 UTC
3+
SHA: 7ad617e81329699deaa43ba4ec44f663bd67fdcb

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: sfo
22
Type: Package
33
Title: San Francisco International Airport Monthly Air Passengers
4-
Version: 0.1.1
4+
Version: 0.1.2
55
Authors@R: person(given = "Rami",
66
family ="Krispin",
77
email = "rami.krispin@gmail.com",
@@ -21,5 +21,5 @@ Suggests:
2121
knitr,
2222
rmarkdown,
2323
tidyr (>= 1.0.0)
24-
RoxygenNote: 7.1.1
24+
RoxygenNote: 7.1.2
2525
VignetteBuilder: knitr

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# sfo 0.1.2
2+
3+
* Updated the passengers and landing datasets - up to Dec 2022
4+
* Updated the package documentation and examples
5+
16
# sfo 0.1.1
27

38
* Updated the passengers data - up to Dec 2020 (including)

R/data.R

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
#' @format A data frame with 12 variables.
44
#' \describe{
55
#' \item{activity_period}{Activity year and month in YYYYMM format}
6-
#' \item{operating_airline}{Airline name for the operator of aircraft}
6+
#' \item{operating_airline}{Airline name for the aircraft operator}
77
#' \item{operating_airline_iata_code}{The International Air Transport Association (IATA) two-letter designation for the Operating Airline}
88
#' \item{published_airline}{Airline name that issues the ticket and books revenue for passenger activity}
99
#' \item{published_airline_iata_code}{The International Air Transport Association (IATA) two-letter designation for the Published Airline}
10-
#' \item{geo_summary}{Designates whether the passenger activity in relation to SFO arrived from or departed to a location within the United States (“domestic”), or outside the United States (“international”) without stops}
11-
#' \item{geo_region}{Provides a more detailed breakdown of the GEO Summary field to designate the region in the world where activity in relation to SFO arrived from or departed to without stops}
10+
#' \item{geo_summary}{The flights’ classification by domestic for flights that arrived from or departed to a destination within the United States and international for destinations outside the United States}
11+
#' \item{geo_region}{The flight origin/destination geographic region details}
1212
#' \item{activity_type_code}{A description of the physical action a passenger took in relation to a flight, which includes boarding a flight (“enplanements”), getting off a flight (“deplanements”) and transiting to another location (“intransit”)}
1313
#' \item{price_category_code}{A categorization of whether a Published Airline is a low-cost carrier or not a low-cost carrier}
14-
#' \item{terminal}{The airport terminal designations at SFO where passenger activity took place}
15-
#' \item{boarding_area}{The airport boarding area designations at SFO where passenger activity took place}
14+
#' \item{terminal}{The airport’s terminal designations at SFO where passenger activity took place}
15+
#' \item{boarding_area}{The airport’s boarding area designations at SFO where passenger activity took place}
1616
#' \item{passenger_count}{The number of monthly passengers associated with the above attribute fields}
1717
#'
1818
#' }
@@ -45,17 +45,17 @@
4545
#' @format A data frame with 14 variables.
4646
#' \describe{
4747
#' \item{activity_period}{Activity year and month in YYYYMM format}
48-
#' \item{operating_airline}{Airline name for the operator of aircraft}
48+
#' \item{operating_airline}{Airline name for the aircraft operator}
4949
#' \item{operating_airline_iata_code}{The International Air Transport Association (IATA) two-letter designation for the Operating Airline}
5050
#' \item{published_airline}{Airline name that issues the ticket and books revenue for passenger activity}
5151
#' \item{published_airline_iata_code}{The International Air Transport Association (IATA) two-letter designation for the Published Airline}
52-
#' \item{geo_summary}{Designates whether the passenger activity in relation to SFO arrived from or departed to a location within the United States (“domestic”), or outside the United States (“international”) without stops}
53-
#' \item{geo_region}{Provides a more detailed breakdown of the GEO Summary field to designate the region in the world where activity in relation to SFO arrived from or departed to without stops}
54-
#' \item{landing_aircraft_type}{A designation for three types of aircraft that landed at SFO, which includes passenger aircraft, cargo only aircraft (“freighters”) or combination aircraft (“combi”)}
55-
#' \item{aircraft_body_type}{A designation that is independent from Landing Aircraft Type, which determines whether commercial aircraft landed at SFO is a wide body jet, narrow body jet, regional jet or a propeller operated aircraft}
52+
#' \item{geo_summary}{The flights’ classification by domestic for flights that arrived from or departed to a destination within the United States and international for destinations outside the United States}
53+
#' \item{geo_region}{ The flight origin/destination geographic region details}
54+
#' \item{landing_aircraft_type}{A designation for three types of aircraft that landed at SFO, which includes passenger aircraft, cargo-only aircraft (“freighters”), or combination aircraft (“combi”)}
55+
#' \item{aircraft_body_type}{A designation that is independent from Landing Aircraft Type, which determines whether commercial aircraft landed at SFO is a wide body-jet, narrow-body jet, regional-jet or a propeller operated aircraft}
5656
#' \item{aircraft_manufacturer}{Manufacturer name for the aircraft that landed at SFO}
5757
#' \item{aircraft_model}{Model designation of aircraft by the manufacturer}
58-
#' \item{aircraft_version}{Variations of the Aircraft Model, also known as the “dash number”, designated by the manufacturer to segregate unique versions of the same model}
58+
#' \item{aircraft_version}{ Variations of the Aircraft Model, also known as the “dash number”, designated by the manufacturer to segregate unique versions of the same model}
5959
#' \item{landing_count}{The number of aircraft landings associated with General and Landings Statistics attribute fields}
6060
#' \item{total_landed_weight}{The aircraft landed weight (in pounds) associated with General and Landings Statistics attribute fields}
6161
#'

R/dataviz.R

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@
55
#' @param cat_cols A vector of at least two categorical columns names
66
#' @param num_col A single numeric column name
77
#' @param title Optional, string to pass to plotly layout title function
8+
#' @examples
9+
#' data("sfo_passengers")
10+
#'
11+
#' library(dplyr)
12+
#'
13+
#' d <- sfo_passengers %>%
14+
#' filter(activity_period >= 202201 & activity_period < 202301)
15+
#'
16+
#' head(d)
17+
#'
18+
#' d %>%
19+
#' filter(operating_airline == "United Airlines") %>%
20+
#' mutate(terminal = ifelse(terminal == "International", "international", terminal)) %>%
21+
#' group_by(operating_airline,activity_type_code, geo_summary, geo_region, terminal) %>%
22+
#' summarise(total = sum(passenger_count), .groups = "drop") %>%
23+
#' sankey_ly(cat_cols = c("operating_airline", "terminal","geo_summary",
24+
#' "geo_region", "activity_type_code"),
25+
#' num_col = "total",
26+
#' title = "Distribution of United Airlines Passengers at SFO During 2022")
827

928

1029
sankey_ly <- function(x, cat_cols, num_col, title = NULL){

R/global_variables.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
globalVariables(
2+
c("activity_period",
3+
"passenger_count",
4+
"landing_count",
5+
"total_landed_weight"))

README.Rmd

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ orca(p, "man/figures/total.svg")
3939

4040
<!-- badges: start -->
4141

42-
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/sfo)](https://cran.r-project.org/package=sfo) [![lifecycle](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![GitHub commit](https://img.shields.io/github/last-commit/RamiKrispin/sfo)](https://github.com/RamiKrispin/sfo/commit/main)
42+
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/sfo)](https://cran.r-project.org/package=sfo) [![lifecycle](https://img.shields.io/badge/lifecycle-stable-green.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit/) [![GitHub commit](https://img.shields.io/github/last-commit/RamiKrispin/sfo)](https://github.com/RamiKrispin/sfo/commit/main)
4343

4444
<!-- badges: end -->
45-
46-
The **sfo** package provides summary statistics of the monthly passengers and landing in San Francisco International Airport (SFO) between 2005 and 2020.
47-
45+
The **sfo** package summarizes the monthly air passengers and landings at San Francisco International Airport (SFO) between 2005 and 2022.
4846
Data source: San Francisco data portal - [DataSF API](https://datasf.org/opendata/)
4947

5048
<img src="man/figures/total.svg" width="90%"/>
@@ -69,13 +67,13 @@ devtools::install_github("RamiKrispin/sfo", ref = "main")
6967
The **sfo** package provides the following two datasets:
7068

7169
* `sfo_passengers` - air traffic passengers statistics
72-
* `sfo_stats` - air traffic landing statistics
70+
* `sfo_stats` - air traffic landings statistics
7371

74-
More information about the datasets available on the following [vignette](https://ramikrispin.github.io/sfo/articles/v1_intro.html).
72+
More information about the datasets is available in the following [vignette](https://ramikrispin.github.io/sfo/articles/v1_intro.html).
7573

7674
### Examples
7775

78-
The `sfo_passengers` dataset provides a monthly summary of the number of passengers in SFO airport by different categories (such as terminal, geo, type, etc.):
76+
The `sfo_passengers` dataset provides monthly summary of the number of passengers in SFO airport by different categories (such as terminal, geo, type, etc.):
7977

8078
```{r }
8179
library(sfo)
@@ -85,7 +83,7 @@ data("sfo_passengers")
8583
head(sfo_passengers)
8684
```
8785

88-
The `sfo_stats` dataset provides a monthly statistics on the air traffic landing at SFO airport:
86+
The `sfo_stats` dataset provides monthly statistics on the air traffic landing at SFO airport:
8987

9088
```{r }
9189
data("sfo_stats")
@@ -107,7 +105,7 @@ sfo_passengers %>%
107105
```
108106

109107

110-
The `sankey_ly` function enables us to plot the distribution of a numeric variable by multiple categorical variables. The following example shows the distribution of the total United Airlines passengers during 2019 by terminal, travel type (domestic and international), geo, and travel direction (deplaned, enplaned, and transit):
108+
The `sankey_ly` function enables us to plot the distribution of a numeric variable by multiple categorical variables. The following example shows the distribution of the total United Airlines passengers during 2019 by a terminal, travel type (domestic and international), geo, and travel direction (deplaned, enplaned, and transit):
111109

112110
``` r
113111
sfo_passengers %>%
@@ -140,11 +138,11 @@ orca(p, "man/figures/sankey.svg")
140138

141139
#### Total number of landing
142140

143-
The total number of landing in most recent month by `activity_type_code` and `aircraft_manufacturer`:
141+
The total number of landings during the most recent month by `activity_type_code` and `aircraft_manufacturer`:
144142

145143
``` r
146144
sfo_stats %>%
147-
filter(activity_period == max(activity_period),
145+
filter(activity_period == 202212,
148146
aircraft_manufacturer != "") %>%
149147
group_by(aircraft_manufacturer) %>%
150148
summarise(total_landing = sum(landing_count),
@@ -153,13 +151,13 @@ sfo_stats %>%
153151
plot_ly(labels = ~ aircraft_manufacturer,
154152
values = ~ total_landing) %>%
155153
add_pie(hole = 0.6) %>%
156-
layout(title = "Landing Distribution by Aircraft Manufacturer during Sep 2020")
154+
layout(title = "Landing Distribution by Aircraft Manufacturer during Dec 2022")
157155
```
158156

159157

160158
```{r, include=FALSE}
161159
p <- sfo_stats %>%
162-
filter(activity_period == max(activity_period),
160+
filter(activity_period == 202212,
163161
aircraft_manufacturer != "") %>%
164162
group_by(aircraft_manufacturer) %>%
165163
summarise(total_landing = sum(landing_count),
@@ -168,18 +166,18 @@ p <- sfo_stats %>%
168166
plot_ly(labels = ~ aircraft_manufacturer,
169167
values = ~ total_landing) %>%
170168
add_pie(hole = 0.6) %>%
171-
layout(title = "Landing Distribution by Aircraft Manufacturer During Sep 2020")
169+
layout(title = "Landing Distribution by Aircraft Manufacturer During Dec 2022")
172170
173171
orca(p, "man/figures/manufacturer.svg")
174172
```
175173

176174
<img src="man/figures/manufacturer.svg" width="100%"/>
177175

178-
The following Sankey plot demonstrate the distribution of number of landing in SFO by region and aircraft type, manufacturer, and body type during Sep 2020:
176+
The following Sankey plot demonstrates the distribution of the number of landing in SFO by region and aircraft type, manufacturer, and body type during Dec 2022:
179177

180178
``` r
181179
sfo_stats %>%
182-
filter(activity_period == max(activity_period)) %>%
180+
filter(activity_period == 202212) %>%
183181
group_by(geo_summary, geo_region, landing_aircraft_type, aircraft_manufacturer, aircraft_body_type) %>%
184182
summarise(total_landing = sum(landing_count),
185183
groups = "drop") %>%
@@ -188,14 +186,14 @@ sfo_stats %>%
188186
"aircraft_manufacturer",
189187
"aircraft_body_type"),
190188
num_col = "total_landing",
191-
title = "Landing Summary by Geo Region and Aircraft Type During Sep 2020")
189+
title = "Landing Summary by Geo Region and Aircraft Type During Dec 2022")
192190

193191
```
194192

195193

196194
```{r, include=FALSE}
197195
p <- sfo_stats %>%
198-
filter(activity_period == max(activity_period)) %>%
196+
filter(activity_period == 202212) %>%
199197
group_by(geo_region, landing_aircraft_type, aircraft_manufacturer, aircraft_body_type) %>%
200198
summarise(total_landing = sum(landing_count),
201199
groups = "drop") %>%
@@ -204,7 +202,7 @@ p <- sfo_stats %>%
204202
"aircraft_manufacturer",
205203
"aircraft_body_type"),
206204
num_col = "total_landing",
207-
title = "Landing Summary by Geo Region and Aircraft Type During Sep 2020")
205+
title = "Landing Summary by Geo Region and Aircraft Type During Dec 2022")
208206
209207
orca(p, "man/figures/landing_sankey.svg")
210208
```

0 commit comments

Comments
 (0)