knitr::opts_chunk$set(echo = TRUE)

Ozflights

Welcome to Ozflights! Get the data for passenger, aircraft and international freight movements for both metropolitan and regional airports in Australia. The dataset covers 1985-2016.

Installation

You can install ozflights from github:

#install.packages("devtools")
devtools::install_github("ropenscilabs/ozflights")

Package Author's Notes

Data was available at URL as at 17/10/26. Data is imported into R and cleaned by removing redundant headers and transforming into a tidy format.

Airport ranking variable was removed: the interested party can recalculate.

Uses the annual airport traffic data from the Australian Government Department of Infrastructure and Regional Development located at: https://bitre.gov.au/publications/ongoing/airport_traffic_data.aspx

Contact details for the data itself can be found in the original spreadsheet, but please don’t contact the aviation stats team for problems with the package!

Airline Passengers

To access the data on airport passengers, use the function airport_passengers().

passengers <- ozflights::airport_passengers()

We'll just look at the total for Australia.

library(ggplot2)
passengers_aus <- dplyr::filter(passengers, airport == "TOTAL AUSTRALIA")
passengers_aus$domest <- factor(passengers_aus$domest, levels = c(TRUE, FALSE), labels = c("Domestic", "International"))
passengers_aus_in <- dplyr::filter(passengers_aus, type == "inbound")
ggplot(passengers_aus_in)+
  labs(x="Year", y="Number of Passengers")+ 
  facet_grid(domest~., scale="free")+
  geom_line(aes(year, count, colour = type))+
  theme_light()+
  ggtitle("Inbound Passengers")


ropenscilabs/ozflights documentation built on May 18, 2022, 4:42 a.m.