Estefy Estefy - 1 year ago 137
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?


Answer Source

@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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download