This function returns all directions with a given ID. Directions that share an ID are not necessarily related, especially if not filtering by route type. It's advised to use to the directions_on_route function to search for directions of interest.

directions(
  direction_id,
  route_type = NULL,
  user_id = determine_user_id(),
  api_key = determine_api_key()
)

Arguments

direction_id

Integer.

route_type

Optionally filter results by a route type. 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.

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 consisting of the following columns:

  • direction_id

  • direction_name,

  • route_id

  • route_type

  • route_type_description

  • route_direction_description

Examples

if (FALSE) { directions(direction_id = 5) directions(direction_id = 5, route_type = "Train") directions(direction_id = 5, route_type = 0) }