Getting Started, Installing R5R

To run r5r, you will need R installed, and the R libraries listed below. You will also need Java SE Development Kit 11, as the R5 model in the background is programmed in Java.

Installing Java SDK 11
You need to have Java SE Development Kit 11 installed on your computer to use r5r. This is free and available from the following links-
Oracle
– OpenJDK
This has to be version 11. Note the software can have problems if a more recent version of Java SE Development Kit is installed.

Installing r5r Library
The r5r library can be installed in R from CRAN-

install.packages("r5r")
library(r5r)

For analysing larger cities, the amount of RAM assigned to Java is important. The default value is 512mb. This can be increased using the following command-

options(java.parameters = "-Xmx5G")

R5R Functions
The r5r package has six main functions:

  1. setup_r5() to initialize an instance of r5r, that also builds a routable transport network;
  2. accessibility() for fast computation of access to opportunities considering a selected decay function;
  3. travel_time_matrix() for fast computation of travel time estimates between origin/destination pairs;
  4. expanded_travel_time_matrix() for calculating travel matrices between origin destination pairs with additional information such routes used and total time disaggregated by access, waiting, in-vehicle and transfer times.
  5. detailed_itineraries() to get detailed information on one or multiple alternative routes between origin/destination pairs.
  6. pareto_frontier() for analyzing the trade-off between the travel time and monetary costs of multiple route alternatives between origin/destination pairs.

We will cover the first three of these functions in this workshop. But first of all we need to get our datasets ready.

Workshop Pages