routes: Information for all routes

View source: R/routes.R

routesR Documentation

Information for all routes

Description

Information for all routes

Usage

routes(
  route_types = NULL,
  route_name = 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.

route_name

Character. Optionally filter by route name. Partial matches are accepted, and the matches are not case sensitive.

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 of routes, with the following columns:

  • route_id

  • route_gtfs_id

  • route_name

  • route_type

  • route_type_description

  • route_number

  • geopath

  • service_status

  • service_status_timestamp

Examples

## Not run: 
routes()
routes(route_types = "Train")
routes(route_types = 0)
routes(route_types = c("Train", "Tram"))
routes(route_name = "Frankston")
routes(route_name = "Craigie")
routes(route_name = "werribee")

## End(Not run)

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