flightFilter: Filter flights with matching conditions.

Description Usage Arguments Value Examples

Description

Choose flight itineraries that match the filter conditions.

Usage

1
2
3
4
5
flightFilter(x, max_price = Inf, max_duration = Inf, max_stops = Inf,
  layover = c(0, Inf), carrier_include = unique(x$carriers$Code),
  carrier_exclude = NULL, out_departure = c("00:00", "24:00"),
  out_arrival = c("00:00", "24:00"), in_departure = c("00:00",
  "24:00"), in_arrival = c("00:00", "24:00"))

Arguments

x

A list of data.frame.

max_price

Maximum price.

max_duration

Maximum duration in minutes, applied to both outbound and inbound legs.

max_stops

Maximum number of stops, applied to both outbound and inbound legs.

layover

Range of layover in minutes, applied to each stop.

carrier_include

Include specified carriers, applied to both outbound and inbound legs. Must be IATA codes.

carrier_exclude

Exclude specified carriers, applied to both outbound and inbound legs. Must be IATA codes.

out_departure

Range of outbound departure time, "hh:mm" or numeric values in minutes.

out_arrival

Range of outbound arrival time, "hh:mm" or numeric values in minutes.

in_departure

Range of inbound departure time, "hh:mm" or numeric values in minutes.

in_arrival

Range of inbound arrival time, "hh:mm" or numeric values in minutes.

Value

A tibble of flight itineraries.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
apiSetKey("skyscanner-skyscanner-flight-search-v1.p.rapidapi.com", "YOUR_API_KEY")
resp <- apiCreateSession(origin = "SFO", destination = "LHR",
                         startDate = "2019-07-01", returnDate = "2019-07-10")
resp <- apiPollSession(resp)
data <- flightGet(resp)
flightFilter(data, max_price = 1000, max_duration = 60 * 24,
             max_stops = 2, layover = c(60, 240),
             carrier_include = c("UA", "AA", "DL", "CX", "NH"),
             carrier_exclude = c("MH", "KE"))

## End(Not run)

MinZhang95/flightscanner documentation built on July 1, 2019, 9:36 p.m.