The great thing is they also provide an API, so it's quite straightforward to access their data from R.
Just sign up for an API key on their website, and the following few lines are what you need for a first exploration.
library(RJSONIO) r2rK <- "<your-API-key-here>" r2rS <- "<server-address-here>" from <- "<origin-location-here>" to <- "<destination-location-here>" url_string <- URLencode(paste0("http://", r2rS, "/api/1.2/json/Search?key=", r2rK, "&oName=", from, "&dName=", to, "¤cy=EUR")) trip <- fromJSON(paste(readLines(url_string), collapse = ""))
You need to provide your key and the server address (both provided by Rome2Rio when you sign up), and the origin and destination (simply type a city name, it will be geocoded!).
Check the API documentation if you need help to understand what's inside the trip object.
Note that paths are encoded Google Maps style... but you already know how to deal with that!