TravelTime Docs logo
TravelTime API
ArcGIS plugin
QGIS plugin
Alteryx plugin
GitHub

traveltimeR: Travel Time R SDK

traveltimeR is a R SDK for Travel Time API (https://traveltime.com/). Travel Time API helps users find locations by journey time rather than using ‘as the crow flies’ distance. Time-based searching gives users more opportunities for personalisation and delivers a more relevant search.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("traveltime-dev/traveltime-sdk-r")

Authentication

In order to authenticate with Travel Time API, you will have to supply the Application Id and Api Key.

library(traveltimeR)

#store your credentials in an environment variable
Sys.setenv(TRAVELTIME_ID = "YOUR_API_ID")
Sys.setenv(TRAVELTIME_KEY = "YOUR_API_KEY")

Usage

Get Isochrones:

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 = 900,
              coords = list(lat = 51.507609, lng = -0.128315),
              transportation = list(type = "public_transport"),
              properties = list('is_only_walking'))

result <- time_map(departure_searches = departure_search)

Also available:

Check function documentation for more examples.