make_search {traveltimeR}R Documentation

Search objects constructor

Description

Searches based on departure or arrival times. Departure: Leave departure location at no earlier than given time. You can define a maximum of 10 searches Arrival: Arrive at destination location at no later than given time. You can define a maximum of 10 searches

Usage

make_search(
  id,
  travel_time = NA,
  coords = NA,
  departure_time = NA,
  arrival_time = NA,
  transportation = list(type = "driving"),
  ...
)

Arguments

id

Used to identify this specific search in the results array. MUST be unique among all searches.

travel_time

Travel time in seconds. Maximum value is 14400 (4 hours)

coords

The coordinates of the location we should start the search from. Must use this format: list(lat = 0, lng = 0)

departure_time

Date in extended ISO-8601 format

arrival_time

Date in extended ISO-8601 format

transportation

Transportation mode and related parameters.

...

Any additional parameters to pass. Some functions require extra parameters to work. Check their API documentation for details.

Value

A data.frame wrapped in a list. It is constructed in a way that allows jsonlite::toJSON to correctly transform it into a valid request body

See Also

See time_map for usage examples


[Package traveltimeR version 1.2.1 Index]