Description Usage Arguments Value Examples
The plot_flights
function use 'ggplot2' to plot flight paths on a world map. The flight path follow the great circle of the Earth, which is computed by 'geosphere'. The function also provides extended functionalities including coloring and cropping.
Since 'ggplot2' is used, additional plotting parameters can be easily added to the result.
1 2 3 4 5 6 7 8 9 10 | plot_flights(
trips,
crop = TRUE,
land_color = "#f6e8c3",
water_color = "aliceblue",
dom_color = "#3288bd",
int_color = "#d53e4f",
alpha = 0.5,
times_as_thickness = TRUE
)
|
trips |
A two-column dataframe - The start and end airports of flights. The first column should be the start airports, and the second column the end airports. The airport value should be IATA airport code. The column names can be any valid names. |
crop |
A logical value or a string - Whether the map should be cropped or not and by which preset the map is cropped. If |
land_color |
A string - the color used for land. Default value is |
water_color |
A string - the color used for earth. Default value is |
dom_color |
A string - the color used for domestic flights. Default value is |
int_color |
A string - the color used for international flights. Default value is |
alpha |
A double number - 0 to 1. The transparency (alpha) of flight paths. Default value is |
times_as_thickness |
A logical value - whether the times of flights are used as aestheic mappings for the thickness of flight paths. Default value is |
A plot
1 | plot_flights(sample_trips[1:20,])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.