search_outlets: Search for outlets using text

Description Usage Arguments Value Examples

View source: R/search.R

Description

This function will search outlets in which the search term can be found in either the outlet name, outlet business or outlet suburb. The search is case-insensitive. The search term must contain at least 3 characters, and cannot be numeric.

Usage

1
2
3
4
5
6
7
8
9
search_outlets(
  search_term,
  latitude = NULL,
  longitude = NULL,
  max_distance = NULL,
  route_types = NULL,
  user_id = determine_user_id(),
  api_key = determine_api_key()
)

Arguments

search_term

Character. Term used to perform search.

latitude

Numeric. Latitude in decimal degrees. For example, Flinders Street Station is at approximately -37.8183 latitude.

longitude

Numeric. Longitude in decimal degrees. For example, Flinders Street Station is at approximately 144.9671 longitude.

max_distance

Integer. Optionally filter by maximum distance from the given location, in metres.

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.

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:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
search_outlets("St Kilda")
search_outlets("St Kilda", route_types = c("Train", "Tram"))
search_outlets("St Kilda", route_types = 1)

search_outlets(
  "St Kilda",
  latitude = -37.867647,
  longitude = 144.976809
)
search_outlets(
  "St Kilda",
  latitude = -37.867647,
  longitude = 144.976809,
  max_distance = 100
)

## End(Not run)

ptvapi documentation built on May 2, 2021, 9:06 a.m.