This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
57 lines (40 loc) · 1.89 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
title: "README"
author: "Mathew Ling, Steph de Silva, Maddie Davey, Nicholas Tierney, Adam Gruer"
date: "27/10/2017"
output: github_document
---
```{r setup, include=FALSE}
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()`.
```{r, fig.show='hold'}
passengers <- ozflights::airport_passengers()
```
We'll just look at the total for Australia.
```{r test-figure, fig.show='hold'}
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")
```