Skip to contents

r5r (development version)

Bug fixes

  • Fix bug related to optimization of origins and destinations. Closes again #501.
  • #569 Fix broken source links in documentation website. Closed #527
  • Origins/destinations passed as sf objects that also carried lon/lat (or x/y) attribute columns were routed using those attribute columns instead of the point geometry. The geometry is now always used.
  • travel_time_matrix(), arrival_travel_time_matrix() and expanded_travel_time_matrix() wrote CSV files with from_id and to_id swapped (and named after the destinations) when output_dir was used with walk-only routing, no elevation data and more origins than destinations. The internal origin/destination swap that speeds up such searches is now skipped whenever output_dir is set, so those runs may take longer than before.
  • percentiles are now sorted in ascending order internally. Unsorted values (e.g. c(75, 25)) used to crash inside R5 with an uninformative Java error.
  • Origins/destinations with missing lon/lat coordinates now trigger a warning listing the affected ids. They used to be dropped silently.
  • Origins/destinations with duplicated id values now raise an error in all one-to-many functions, instead of returning ambiguous duplicated rows. detailed_itineraries() keeps accepting repeated ids in row-paired inputs (all_to_all = FALSE).
  • FERRY was missing from the list of transit modes that trigger the check for transit services on the departure date.
  • max_car_time now caps car-only trips, as max_walk_time and max_bike_time already did for walk-only and bike-only trips. It used to apply only to car access/egress legs of transit trips.
  • accessibility() with the logistic, exponential and linear decay functions ignored every trip longer than max(cutoffs), although these curves still give weight to such trips, so accessibility was underestimated. max_trip_duration is now capped by max(cutoffs) only for the step function (the cap was introduced in r5r 2.1.0, #348). Results of the other decay functions change and are now larger.
  • accessibility() now accepts fractional opportunity values (e.g. population interpolated onto a grid). They used to be truncated to integers, so any value below 1 counted as 0. Missing values are treated as 0, now with a warning, and infinite values raise an error.
  • cutoffs in accessibility() are now validated (whole numbers between 1 and 120, no duplicates) and sorted in ascending order. Unsorted or out-of-range values used to crash inside R5 with an uninformative Java error, and duplicated values returned duplicated rows.
  • In accessibility(), the decay_value of the linear decay function is now required to be a whole number of minutes between 1 and 59. Fractional values used to be silently truncated by R5, and values of 60 or more crashed inside R5.
  • detailed_itineraries() reported transfer walks with a duration re-computed by the street router instead of the one R5 used to find, filter and rank the itineraries. On networks built with elevation data this could give impossible timelines (e.g. 40 minutes to walk 119 m followed by a normal wait) and itineraries longer than max_trip_duration, and shortest_path = TRUE could pick an option whose reported duration was not the shortest. Transfer walks now keep R5’s duration (walking distance / walk_speed), consistent with travel_time_matrix() and expanded_travel_time_matrix().
  • In detailed_itineraries(), transfer walks from or to the stop with internal index 0 (the first stop of the transit network) kept a straight line between the two stops as geometry, a straight-line distance and no OSM or edge ids. They are now routed on the street network like all other transfers.
  • CSV files written with output_dir did not quote text values, so any value containing a comma broke the file. This made every file written by detailed_itineraries() unreadable (its WKT geometry and its osm_id_list / edge_id_list columns always contain commas), and broke the files of any routing function when an id or route name contained a comma. Such values are now quoted following the CSV standard (RFC 4180); files without such values are unchanged.
  • detailed_itineraries() with output_dir silently overwrote the file of a repeated origin-destination pair (allowed since row-paired inputs may repeat ids), and crashed with a Java error on ids containing characters not allowed in file names (e.g. /). It now raises an informative error in both cases.
  • detailed_itineraries() with zero-row origins or destinations crashed inside Java. It now returns an empty result.
  • A finite max_fare passed without a fare_structure now raises an error instead of being silently ignored.
  • Integer arguments (max_walk_time, max_bike_time, max_car_time, max_trip_duration, time_window, percentiles, n_threads, max_rides, max_lts, draws_per_minute, cutoffs, suboptimal_minutes) now reject non-integer values instead of silently truncating them.
  • build_network() now detects and aborts with an informative message when a cached network.dat triggers a silent internal rebuild that fails on high priority GTFS errors, instead of silently returning an unusable r5r_network that only fails later with an opaque NullPointerException on the first routing call.

Minor changes

  • detailed_itineraries() now builds street paths and geometries only for the itineraries it returns, instead of for every candidate found by the router (including those later dropped by max_trip_duration or shortest_path). Results are identical. In benchmarks with the Porto Alegre sample data, the gain in computation time was within run-to-run noise, since most of the time is spent in the routing search itself.
  • The deprecated r5r_core argument is now the last argument of every function. It used to be the second one, so positional calls such as travel_time_matrix(r5r_network, origins, destinations) bound origins to r5r_core and failed with a misleading deprecation warning and error.
  • Documentation fixes: carspeed_scale defaults to 1 (not NULL), and the unsupported modes BICYCLE_RENT and CAR_PARK were removed from the list of transport modes.
  • The documentation of detailed_itineraries() now lists the output columns and how itinerary options are ordered, and describes the osm_link_ids columns correctly (board_stop_id and alight_stop_id are feed-prefixed GTFS stop ids, not OSM ids; edge_id_list is also added). It also explains that shortest_path = TRUE picks the itinerary with the shortest travel time among all departures within time_window (not the earliest arrival), and that suboptimal_minutes requires shortest_path = FALSE and no fare_structure.
  • The documentation of the fixed_exponential decay function in accessibility() now states that its decay constant is applied to travel times in seconds, so per-minute constants must be divided by 60.
  • #571 Update logging when building GTFS network with multiple feeds.
  • #568 Update logging for direct trip router. Closed #557

r5r 2.4.0

CRAN release: 2026-05-20

Major changes

  • Using new version of R5 v7.5.1. Closed #373 and #970
  • The isochrone() function has gone through major changes which substantially improved polygon-based isochrones. The function now builds on top of a travel time surface that uses a regular grid of points across the network (specifically a grid of Web Mercator pixels) and then uses the marching squares algorithm to generate the isochrone polygons. See detailed in the updated vignette. Closed #455 and Closed #495.
  • New support function get_gtfs_errors() to help diagnose eventual errors in the GTFS data that prevent building the network. Closed #431 and #541.

Minor changes

  • New support function check_transit_availability() that checks the number and proportion of public transport services from the GTFS feeds that are active on specified dates.
  • New support function street_network_bbox() that efficiently extracts the geographic bounding box of the transport network.
  • More informative messages in case of Java error in R5. Closed #515.
  • When direct routing fails the log now mentions the name of the origin and destination points to help the user debug. Closed #519.

Bug fixes

  • Revert back the order of origins destinations for Direct Modes. Fix implemented in travel_time_matrix(), arrival_travel_time_matrix() and expanded_travel_time_matrix(). Closes #501.
  • Reverse search optimization is now only applicable to walking. Closes #517.
  • r5r now uses walking speed from request location to snapped point on the road network. This was a fix upstream in R5. Closed #373
  • Elevation data does not affect carspeeds anymore. This was a fix upstream in R5. Closed #970
  • Fixed a bug that was introduced in r5r {2.3.0} and which led to ignore elevation when building the network. Closed #555. Elevation data is still ignored when creating scenarios of LTS, but this is a know bug that will throw warning messages while we work a way to fix it in a future update.

New contributors to r5r

r5r 2.3.0

CRAN release: 2025-08-21

Major changes

  • New function build_network() to replace setup_r5(), which is being deprecated. Idiomatically r5r_core is now r5r_network.
  • New function arrival_travel_time_matrix() to calculate travel time matrix between origin destination pairs considering the time of arrival, instead of a depature time. Closes #291
  • We have now implemented a reverse search optimization for direct transport modes (walking and cycling) in the functions travel_time_matrix(), expanded_travel_time_matrix() and arrival_travel_time_matrix(). In practice, this means that these functions are now much faster when there are multiple origins to few destinations but only when there is no elevation .tif file in the data path. Closes #450
  • All routing and accessibility functions in r5r have new parameters new_carspeeds, carspeed_scale and new_lts which allow one to use custom car speeds and LTS levels for cycling. These parameters provide convient and efficient ways to build different scenarios of traffic congestion, road closure and interventions in cycling infrastructure. Closes #289

Minor changes

  • The routable transport network built with build_network() and setup_r5() now have their own class "r5r_network", making the package more consistent and safer from errors #472.
  • Routing properties within r5r jar (aka little jar) are reset to default after a routing execution #453
  • Less cluttering messages in r5r dialogue. Removed logback startup messages. Verbose=F now completly silences java output. Verbose=T only reports messages up to INFO level as opposed to up to DEBUG #456.
  • Removed date from r5r-log. You no longer have to delete the previous day’s log! #456
  • Improved warning and error messages.
  • r5r developers can now set options(r5r.r5jar=...) to use a local JAR instead of the R5 jar downloaded by r5r.

Bug fixes

  • Fixed a bug where network_settings.json wasn’t showing the right version numbers #459. Version number now dynamically updated #456.

New co-authors

  • Alex Magnus

r5r 2.2.0

CRAN release: 2025-05-22

Major changes

  • r5r now uses the latest version of R5 V7.4. Closed #436
  • The detailed_itineraries() now has a new parameter osm_link_ids. A logical. Whether the output should include the additional columns with the OSM ids of the road segments used along the trip geometry Defaults to FALSE. Closes issues #298

Minor changes

  • r5r now throws an informative error message when the geographic extent of input data exceeds limit of 975000 km2. Closes issues #389, #405, #406, #407, #412 and #421. Thanks to PR #426 by Alex Magnus.
  • removed JRI dependency in r5r little jar. This helps debugging issues in Java without the need of using R. The side effect is that r5r now creates an r5rlog file in the data path.

Bug fixes

  • Fixed a bug that prevented the package to check the availability of transit services in specific days when there is no service at all.
  • Fixed a bug in the isochrone function that was throwing false error message regarding cutoff being too short. Closed #434 and #433

New contributors

  • Alex Magnus
  • Luyu Liu
  • Daniel Snow
  • Funding from the Department of Geography & Planning, University of Toronto via the Bousfield Visitorship.

r5r 2.1.0

CRAN release: 2025-03-08

Minor changes

  • The isochrone() function has a new boolean parameter polygon_output that allows users to choose whether the output should be a polygon- or line-based isochrone. Closed #382
  • When using public transit modes, the package now automatically detects whether there are any transit services operation on the seleced departure date. If there are no services, the package will return an error message. Closed #326

r5r 2.0

CRAN release: 2024-04-11

Breaking changes

  • r5r uses now JDK 21 or higher (Breaking changes). Closed #350.
  • r5r now uses the latest version of R5 V7.1. Closed #350

Major changes

  • r5r now stores R5 Jar file at user dir using tools::R_user_dir()
  • New function r5r_cache() to manage the cache of the R5 Jar file.
  • By using the JDK 21, this version of r5r also fixed an incompatibility with MAC ARM processors. Closed #315

Minor changes

  • In the accessibility() function, the value of max_trip_duration is now capped by the max value passed to the cutoffs parameter. Closes #348.
  • Updated documentation of parameter max_walk_time to make it clear that in walk-only trips, whenever max_walk_time differs from max_trip_duration, the lowest value is considered. Closes #353
  • Updated documentation of parameter max_bike_time to make it clear that in bicycle-only trips, whenever max_bike_time differs from max_trip_duration, the lowest value is considered. Closes #353
  • Improved documentation of parameter suboptimal_minutes in the detailed_itineraries() function.
  • Updated the vignette on time window to explain how this parameter behaves when used in the detailed_itineraries() function.

Bug Fixes

  • Fixed bug that prevented the use the output_dir parameter in the detailed_itineraries(all_to_all = TRUE) function. Closes #327 with a contribution (PR #354) from Luyu Liu.
  • Fixed bug that prevented detailed_itineraries from working with frequency-based GTFS feeds. It should ONLY work with frequency-based GTFS feeds.

New contributors to r5r

r5r 1.1.0

CRAN release: 2023-08-08

Major changes

  • New isochrone()function. Closes #123, and addresses requrests in issues #164 and #328.
  • New vignette about calculating / visualizing isochrones with r5r.
  • New vignette with responses to frequently asked questions (FAQ) from r5r users.

Minor changes

  • The default value of time_window is not set to 10 minutes in all functions to avoid weird results reported upstream in R5. Closes #342.
  • Removed any mention to percentiles parameter in the expanded_travel_time_matrix() because this function does not expose this parameter to users. Closes #343.
  • Updated vignette on calculating / visualizing accessibility with r5r.

r5r 1.0.1

CRAN release: 2023-03-06

Bug fixes

  • Updated to R5 version 6.9. This fixed a few bugs upstream, one of which often prevented users to build a network using cropped OSM data. Closes #325.

r5r 1.0.0

CRAN release: 2023-01-27

Breaking changes

  • Replaced max_walk_dist and max_bike_dist parameters with max_walk_time and max_bike_time to better align with R5 inputs. Closes #273.
  • r5r now uses R5’s native elevation weighting for walking and cycling impedance functions. As a result r5r does not have raster or rgdal package dependencies anymore. Closes #243 and #233.
  • Parameters breakdown and breakdown_stat in travel_time_matrix() were removed. New function expanded_travel_time_matrix() should be used to retrieve detailed information of travel time matrices.
  • r5rnow throws an error if users simultaneously pass more than one of the following modes c('WALK','CAR','BICYCLE') to the transport_mode parameter. This is because these modes are understood as mutually exclusive.
  • Function setup_r5() no longer has a version parameter.

New functions

  • New function expanded_travel_time_matrix() to calculate minute-by-minute travel times between origin destination pairs and get additional information on public transport routes, number of transfers, and total access, waiting, in-vehicle and transfer times.
  • New function pareto_frontier() to compute of travel time and monetary cost Pareto frontier.
  • New function r5r_sitrep() to generate an r5r situation report to help debug code errors
  • New functions to account for monetary costs:

Major changes

  • Now using R5 latest version 6.8.
  • The detailed_itineraries() has been substantially improved. The new vesion is faster than previous ones. It also includes new parameters listed below. Closes #265.
    • New time_window parameter
    • New suboptimal_minutes parameter, which extends the search space and returns a larger number of trips beyond the fastest ones;
    • Support for fare calculator and new max_fare parameter;
    • Routing in frequencies GFTS, including support for Monte Carlo draws
  • New parameter draws_per_minute to travel_time_matrix(), accessibility() and pareto_frontier() functions. Closes #230.
  • New parameter output_dir to all routing functions, which can be used to specify a directory in which the results should be saved as .csv files (one file for each origin). This parameter is particularly useful when running estimates on memory-constrained settings, because writing the results to disk prevents R5 from storing them in memory.
  • The accessibility estimates from accessibility() are now of returned as doubles / class numeric, except when using a step decay function. Closes #235.
  • The detailed_itineraries() function has a new parameter all_to_all, which allows users to set whether they want to query routes between all origins to all destinations (all_to_all = TRUE) or to query routes between the 1st origin to the 1st destination, then the 2nd origin to the 2nd destination, and so on (all_to_all = FALSE, the default). Closes #224.

Minor changes

  • Package documentation has been extensively updated and expanded.
  • Improved documentation of the cutoffs parameter in accessibility(), clarifying the function only accepts up to 12 cutoff values. Closes #216.
  • Improved documentation of the percentiles parameter in accessibility() and travel_time_matrix(), clarifying these function only accepts up to 5 values. Closes #246.
  • r5r now downloads R5 Jar directly from Conveyal’s github, making the package more stable. Closes #226.
  • All functions now use verbose = FALSE and progress = FALSE by default.
  • Routing functions now require users to be non-ambiguous when specifying the modes, raising errors when it cannot disambiguate them. This new behaviour replaces the old one, in which the functions could end up trying to “guess” which mode was to be used in some edge cases.
  • Information on bicycle ‘level of traffic stress’ is now added to the output of street_network_to_sf(). Closes #251.
  • New columns with info on population, schools and jobs in the example data sets for Sao Paulo and Porto Alegre

Bug fixes

  • Fixed bug that transit_network_to_sf() generated some routes with invalid geometries. Closes #256.
  • Fixed bug that prevented setup_r5(path, overwrite = TRUE) to work.

r5r 0.7.1

CRAN release: 2022-07-05

Minor change

  • Replaced the akima package with interp package in r5r Suggests, as requested by CRAN.

r5r 0.7.0

CRAN release: 2022-02-11

Major changes

  • From this version onwards, r5r downloads R5 JAR from github, which provides more stable connection than Ipea server.
  • The number of Monte Carlo draws to perform per time window minute when calculating travel time matrices and when estimating accessibility is now set via the r5r.montecarlo_draws option. Defaults to 5. This would mean 300 draws in a 60 minutes time window, for example. The user may also set a custom value using options(r5r.montecarlo_draws = 10L) (in which you substitute 10L by the value you want to set).

Minor changes

  • Changed total_time column name to combined_time in travel_time_matrix() output, to avoid confusion with travel_time column.

r5r 0.6.0

CRAN release: 2021-10-26

Major changes

  • Updated R5 to version 6.4. Closes #182.

  • Significant performance improvements in all functions, due to a faster method for consolidating outputs. Closes #180

  • New function transit_network_to_sf(), to extract the public transport network from R5 as simple features. Closes #179

  • New progress parameter in the accessibility(), travel_time_matrix, and detailed_itineraries() functions, to show or hide the progress counter indicator. Closes #186

  • Created new support function java_to_dt() and removed dependency on the jdx package. Closes #206

  • Reduced r5r’s internet dependency quite considerably. Internet is now only required to download the latest R5 jar if it hasn’t been downloaded before. Closes #197.

  • Added two new parameters breakdown and breakdown_stat to the travel_time_matrix(). This allows users to breakdown the travel time information by trip subcomponents (access time, waiting time, traveling time etc). It allows one to extract more information but it makes computation time slower. Closes #194

Minor changes

  • New setup_r5() parameter, overwrite, that forces the building of a new network.dat, even if one already exists.
  • Improved documentation of parameter departure_datetime to clarify the parameter must be set to local time. Closes #188
  • Improved documentation regarding personalized LTS values. Closes #190.
  • Improved documentation of transit_network_to_sf() regarding stops that are not snapped to road network. Closes #192.
  • Improved documentation of max_walking_dist and max_cycling_dist parameters. Closes #193.
  • Started raising an error if the CRS of origins/destinations is not WGS 84. Closes #201.

r5r 0.5.0

CRAN release: 2021-07-02

Major changes

  • New function accessibility() to calculate access to opportunities. Closes #169

  • New function find_snap() to help users identify where in the street network the input of origin and destination points are snapped to. Closes 168.

  • New parameter max_bike_dist added to routing and accessibility functions. Closes #174

  • Implemented temporary solution for elevation. Closes #171. Now r5r can read Digital Elevation Model (DEM) data from raster files in .tif format to weight the street network for walking and cycling according to the terrain’s slopes. Ideally, we would like to see a solution that accounts for elevation implemented upstream in R5. For now, this is a temporary solution implemented within r5r.

Minor changes

  • The street_network_to_sf() now has a more clean output when the provided GTFS covers a larger area than the street network pbf. Closes #173

  • The size of poa.zip sample GTFS data has been reduced due to CRAN policies. Closes #172.

  • Progress counter Implemented. Closes 150. When the verbose parameter is set to FALSE, r5r prints a progress counter and eventual ERROR messages. This comes with a minor penalty for computation performance. Hence we have kept verbose defautls to TRUE.

Bug fixes

  • Fixed bug that prevented r5r from running without internet connection. Closes #163.

r5r 0.4-0

Major changes

Minor changes

  • New support function check_connection() to check internect connection before download files from Ipea server.

r5r 0.3-3

CRAN release: 2021-03-09

Major changes

Minor changes

Bug fixes

r5r 0.3-2

CRAN release: 2021-01-08

Minor changes

  • r5r does not save the medatada file in the package directory anymore, following CRAN’s policies. Closed #136.

r5r 0.3-1

CRAN release: 2021-01-07

Minor changes

  • Allow for combination of bicycle and public transport. Closed #135.
  • Added new parameter mode_egress to routing functions, so that users can explicitly set the transport mode used after egress from public transport (walk, car or bicycle). Closed #63.
  • Allow for using the r5r package off-line, provided the user has successfully ran setup_r5() before.

r5r 0.3-0

CRAN release: 2021-01-05

Major changes

  • Added Conveyal’s R5 repo as a git submodule. This will help improve the long term integration between r5r and R5. Closed #105.
  • Internal changes to make r5r compatible with R5 latest version 6.0.1.

Minor changes

  • Added columns with population and number of schools in sample data set of Porto Alegre to allow for accessibility examples. Closed #128.
  • The percentiles parameter in the travel_time_matrix function now only accepts up to 5 cut points due to changes in R5.

r5r 0.2-1

CRAN release: 2020-11-30

Minor changes

  • Expanded number of routes in the sample GTFS for Porto Alegre, allowing for more complex/realistic examples.
  • Fixes format of columns of the output of travel_matrix_function when the user sets time_window parameter. Closes #127.
  • Remove repeated bus route alternatives from the output from detailed_itineraries
  • Explicitly link destination points to street network before starting. Closes #121

r5r 0.2-0

CRAN release: 2020-10-20

Major changes

  • Function travel_time_matrix now has new parameters time_window and percentiles it now calculates travel times for multiple departure times each minute within a given time window. For now, the function automatically set the number of Monte Carlo Draws to 5 times the size of time_window. Closes #104 and #118

Minor changes

  • Added a sample of frequency-based GTFS for Sao Paulo. Closed #116
  • Improved documentation of routing functions adding more info on the routing algorithms used in R5. Closes #114

r5r v0.1-1

CRAN release: 2020-09-25

Minor changes

  • Fixed issues with time zone when setting departure times
  • Fixed issues to address CRAN checks
    • Now r5r can be installed on R (>= 3.6)
    • Appropriate hyperlinks indocumentation
    • Metadata is now downloaded from https:// server

r5r 0.1-0