Estefy Estefy - 7 months ago 65
R Question

Google Maps shortest distance

I have a dataset with start (X) and end (Y) coordinates. I want to extract the shortest distance from X to Y using Google Maps. Is there any package/function I can use to do this in R?



@Dave2e is right. use the function mapdist() from library(ggmap). It has also an argument to set the type of distance to compute (see function argument mode = c("driving", "walking", "bicycling")). Remember that google maps api limits to 2500 element queries a day.