# 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(8.34234, 48.23424), c(8.34423, 48.26424))
# simple call
try( ors_directions(coordinates, preference="fastest") )
# customized options
try( ors_directions(coordinates, profile="cycling-mountain", elevation=TRUE) )
# list of locations as `data.frame` output as simple features `sf` object
locations <- data.frame(lng = c(8.34234, 8.327807, 8.34423),
lat = c(48.23424, 48.239368, 48.26424))
try( ors_directions(locations, output = "sf") )
}
Run the code above in your browser using DataLab