README.md

flightplot

R Package to Plot the Paths of Flights on the World Map

Build Status Build status Version Download

flightplot is not under active development. However, pull requests and suggestions are always welcomed.

Installation

Please use the following code to install and load the package:

install.packages("flightplot")
library(flightplot)

If you would like to install the most up-to-date version on GitHub:

if (!require("devtools")) {
  install.packages("devtools")
}

install_github("xmc811/flightplot")
library(flightplot)

Examples

The main plot function plot_flights() accepts a two-column dataframe as input, with one column as departure airports and the other as arrival. The values of airports should be IATA 3-letter codes. sample_trips is an example dataframe that can be readily used for plotting. The columns names can be any valid names.

sample_trips

| Departure | Arrival | |-----|-----| | LAX | IAH | | IAH | LAX | | SFO | IAH | | IAH | ORL | | ORL | IAH | | IAH | DEN | | DEN | IAH | | ... | ... |

To call the main plot function:

plot_flights(sample_trips)

The map can be set to be cropped to presets:

plot_flights(sample_trips, crop = "48States")

Some additional parameters can be adjusted:

plot_flights(sample_trips,
             crop = "48States", 
             land_color = "#fdae6b", 
             water_color = "#9ecae1", 
             dom_color = "white", 
             int_color = "black", 
             alpha = 1,
             times_as_thickness = FALSE)



xmc811/flightplot documentation built on May 22, 2021, 4:04 p.m.