time_filter_postcodes {traveltimeR}R Documentation

Time Filter (Postcodes)

Description

Find reachable postcodes from origin (or to destination) and get statistics about such postcodes. Currently only supports United Kingdom.

Usage

time_filter_postcodes(departure_searches = NULL, arrival_searches = NULL)

Arguments

departure_searches

One or more objects created by make_search

arrival_searches

One or more objects created by make_search

Details

See https://docs.traveltime.com/api/reference/postcode-search/ for details

Value

API response parsed as a list and as a raw json

Examples

## Not run: 
departure_search <-
 make_search(id = "public transport from Trafalgar Square",
             departure_time = strftime(as.POSIXlt(Sys.time(), "UTC"), "%Y-%m-%dT%H:%M:%SZ"),
             travel_time = 1800,
             coords = list(lat = 51.507609, lng = -0.128315),
             transportation = list(type = "public_transport"),
             properties = list('travel_time', 'distance'))

arrival_search <-
  make_search(id = "public transport to Trafalgar Square",
              arrival_time = strftime(as.POSIXlt(Sys.time(), "UTC"), "%Y-%m-%dT%H:%M:%SZ"),
              travel_time = 1800,
              coords = list(lat = 51.507609, lng = -0.128315),
              transportation = list(type = "public_transport"),
              properties = list('travel_time', 'distance'))

result <-
  time_filter_postcodes(
    departure_searches = departure_search,
    arrival_searches = arrival_search
  )

## End(Not run)

[Package traveltimeR version 1.2.1 Index]