Package 'sfo'

Title: San Francisco International Airport Monthly Air Passengers
Description: Provides monthly statistics on the number of monthly air passengers at SFO airport such as operating airline, terminal, geo, etc. Data source: San Francisco data portal (DataSF) <https://data.sfgov.org/Transportation/Air-Traffic-Passenger-Statistics/rkru-6vcg>.
Authors: Rami Krispin [aut, cre]
Maintainer: Rami Krispin <[email protected]>
License: MIT + file LICENSE
Version: 0.1.2
Built: 2024-11-14 04:29:20 UTC
Source: https://github.com/cran/sfo

Help Index


Sankey Plot with Plotly

Description

Sankey Plot with Plotly

Usage

sankey_ly(x, cat_cols, num_col, title = NULL)

Arguments

x

A data.frame input, must have at least two categorical columns and one numeric column

cat_cols

A vector of at least two categorical columns names

num_col

A single numeric column name

title

Optional, string to pass to plotly layout title function

Details

A customized function for data transformation and plotting sankey plot with Plotly

Examples

data("sfo_passengers")

library(dplyr)

d <- sfo_passengers %>%
  filter(activity_period >= 202201 & activity_period < 202301)

head(d)

d %>%
  filter(operating_airline == "United Airlines") %>%
  mutate(terminal = ifelse(terminal == "International", "international", terminal)) %>%
  group_by(operating_airline,activity_type_code, geo_summary, geo_region,  terminal) %>%
  summarise(total = sum(passenger_count), .groups = "drop") %>%
  sankey_ly(cat_cols = c("operating_airline", "terminal","geo_summary",
                         "geo_region", "activity_type_code"),
            num_col = "total",
            title = "Distribution of United Airlines Passengers at SFO During 2022")

SFO Airport Air Traffic Passenger Statistics

Description

Monthly summary of number of passengers in San Francisco International Airport (SFO)

Usage

sfo_passengers

Format

A data frame with 12 variables.

activity_period

Activity year and month in YYYYMM format

operating_airline

Airline name for the aircraft operator

operating_airline_iata_code

The International Air Transport Association (IATA) two-letter designation for the Operating Airline

published_airline

Airline name that issues the ticket and books revenue for passenger activity

published_airline_iata_code

The International Air Transport Association (IATA) two-letter designation for the Published Airline

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

geo_region

The flight origin/destination geographic region details

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”)

price_category_code

A categorization of whether a Published Airline is a low-cost carrier or not a low-cost carrier

terminal

The airport’s terminal designations at SFO where passenger activity took place

boarding_area

The airport’s boarding area designations at SFO where passenger activity took place

passenger_count

The number of monthly passengers associated with the above attribute fields

Details

The dataset contains the monthly summary of number of passengers in San Francisco International Airport (SFO)

Source

San Francisco data portal (DataSF) website.

Examples

data(sfo_passengers)

require(dplyr)

# Get summary of total number of passengers by activity type
# in most recent month
sfo_passengers %>%
  filter(activity_period == max(activity_period)) %>%
  group_by(activity_type_code) %>%
  summarise(total = sum(passenger_count), .groups = "drop")

# Get summary of total number of passengers by
# activity type and geo region in most recent month
sfo_passengers %>%
filter(activity_period == max(activity_period)) %>%
  group_by(activity_type_code, geo_region) %>%
  summarise(total = sum(passenger_count), .groups = "drop")

SFO Airport Air Landings Statistics

Description

Monthly statistics on San Francisco International Airport (SFO) landings

Usage

sfo_stats

Format

A data frame with 14 variables.

activity_period

Activity year and month in YYYYMM format

operating_airline

Airline name for the aircraft operator

operating_airline_iata_code

The International Air Transport Association (IATA) two-letter designation for the Operating Airline

published_airline

Airline name that issues the ticket and books revenue for passenger activity

published_airline_iata_code

The International Air Transport Association (IATA) two-letter designation for the Published Airline

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

geo_region

The flight origin/destination geographic region details

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”)

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

aircraft_manufacturer

Manufacturer name for the aircraft that landed at SFO

aircraft_model

Model designation of aircraft by the manufacturer

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

landing_count

The number of aircraft landings associated with General and Landings Statistics attribute fields

total_landed_weight

The aircraft landed weight (in pounds) associated with General and Landings Statistics attribute fields

Details

The dataset contains the monthly statistics on the air traffic landings in San Francisco International Airport (SFO)

Source

San Francisco data portal (DataSF) website.

Examples

data(sfo_stats)

require(dplyr)

# Get summary of total landing and weight by geo region
# in most recent month
sfo_stats %>%
  filter(activity_period == max(activity_period)) %>%
  group_by(geo_region) %>%
  summarise(total_landing = sum(landing_count),
            total_weight = sum(total_landed_weight),
  .groups = "drop")