demo/example4.R

library(gmapsdistance)

# Compute the travel distance and time matrices between two vectors of cities and return the results in long format

origin = c("Washington+DC", "Miami+FL")
destination = c("Los+Angeles+CA", "Austin+TX", "Chicago+IL")

results = gmapsdistance(origin, destination, mode = "driving", shape = "long")
results$Time
results$Distance
results$Status

Try the gmapsdistance package in your browser

Any scripts or data that you put into this service are public.

gmapsdistance documentation built on Aug. 29, 2018, 1:04 a.m.