# Distances between geocoded pharmacies:
data(health1)
# Health service locations (physicians and pharmacies)
pharmacy <- health1[health1$type=="pharm",]
# Only pharmacies
pharmdistmat <- dist.mat (pharmacy[1:10,], "location", "lat", "lon",
pharmacy, "location", "lat", "lon")
# Distance matrix for the first 10 pharmacy locations
Run the code above in your browser using DataLab