filter_departures: Filter parsed departures content according to user input

View source: R/departures.R

filter_departuresR Documentation

Filter parsed departures content according to user input

Description

The departures API call isn't always reliable. This function will take a tibble of parsed departures content and filter it according to the following inputs, if they are not NULL:

  • Only departures after the given departs

  • Only departures on the given route ID

  • The next max_results departures per route ID, if max_results is not 0.

Usage

filter_departures(parsed, departs = NULL, route_id = NULL, max_results = NULL)

Arguments

parsed

A tibble of parsed departures content.

departs

POSIXct in the "Australia/Melbourne" time zone.

route_id

Integer.

max_results

Integer max results.

Value

A filtered tibble.


ptvapi documentation built on May 29, 2024, 4:48 a.m.