Learn R Programming

graphicalExtremes (version 0.3.2)

getFlightGraph: Get flight graph

Description

Convert the info from flights$flightCounts to an igraph::graph object.

Usage

getFlightGraph(IATAs = NULL, years = NULL, minNFlights = 1, directed = FALSE)

Value

An igraph::graph object containing a vertex for each airport and an edge whenever there are at least minNFlights between two airports.

Arguments

IATAs

Character vector. IATA codes of airports to include

years

Character vector. Years to include (as strings).

minNFlights

Numerical scalar. Minimum number of flights on a connection to be included as an edge.

directed

Logical scalar. Whether flights A->B and B->A should be considered separately.

See Also

Other flight data related topics: flightCountMatrixToConnectionList(), flights, getFlightDelayData(), plotFlights()

Examples

Run this code
g <- getFlightGraph()

Run the code above in your browser using DataLab