# These examples might require interaction to query the local keyring, or
# might fail due to network issues, so they are not run by default
if (FALSE) {
coordinates <- list(
c(9.970093, 48.477473),
c(9.207916, 49.153868),
c(37.573242, 55.801281),
c(115.663757,38.106467)
)
# query for duration and distance in km
res <- ors_matrix(coordinates, metrics = c("duration", "distance"), units = "km")
# duration in hours
res$durations / 3600
# distance in km
res$distances
}
Run the code above in your browser using DataLab