disruptions: Information for all disruptions

View source: R/disruptions.R

disruptionsR Documentation

Information for all disruptions

Description

Information for all disruptions

Usage

disruptions(
  route_types = NULL,
  disruption_modes = NULL,
  disruption_status = NULL,
  user_id = determine_user_id(),
  api_key = determine_api_key()
)

Arguments

route_types

Integer or character vector. Optionally filter by a vector of route types. A route type can be provided either as a non-negative integer code, or as a character: "Tram", "Train", "Bus", "Vline" or "Night Bus". Character inputs are not case-sensitive. Use the route_types function to extract a vector of all route types. The filter is applied to the disruption mode, rather than the routes that are affected by the disruption. For example, filtering by the "train" route type will restrict the disruptions returned to those with a mode corresponding to "metro_train".

disruption_modes

Integer vector. Optionally filter by disruption modes. For a full list of modes and their corresponding descriptions, use the disruptions_modes function.

disruption_status

Character. Can be used to filter to either "current" or "planned" disruptions. Defaults to NULL, in which case no filter is applied.

user_id

Integer or character. A user ID or devid provided by Public Transport Victoria. Refer to ?ptvapi for more details.

api_key

Character. An API key, with dashes, provided by Public Transport Victoria. Refer to ?ptvapi for more details.

Value

A tibble with the following columns:

  • disruption_mode

  • disruption_mode_description

  • disruption_id

  • title

  • url

  • description

  • disruption_status

  • disruption_type

  • published_on

  • last_updated

  • from_date

  • to_date

  • routes

  • stops

  • colour

  • display_on_board

  • display_status

Examples

## Not run: 
disruptions()
disruptions(route_types = c("Train", "Tram"))
disruptions(disruption_modes = c(0, 1))
disruptions(disruption_status = "current")

## End(Not run)


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