0

I am using googleway package in R to calculate distances between two points. I had 2 variables names household latitude and longitude and 2 other variables containing lat and long of the corresponding government cooperative store in the locality of the household. So one can easily specify the origin and destination coordinates.

But now i want to calculate the distance of a household from all the household in its locality. There are 12 localities in total, and in each locality there are about 50 (with some variation) households. So for each locality, i need to calculate 49 distances(excluding itself). Can someone help me on how to do it?

  • 2
    Hi Shweta and welcome to StackOverflow! Could you provide a minimal reproducible example with examples of the code you're using so that we could help you? You can learn how to make a reproducible example through [this answer](https://stackoverflow.com/a/5963610/9956805) – Rekyt Oct 11 '18 at 11:09
  • I [show you how to do this in the vignette](https://github.com/SymbolixAU/googleway/blob/master/vignettes/googleway-vignette.Rmd#google-distance-api) – SymbolixAU Oct 11 '18 at 20:52
  • and there's also [this answer](https://stackoverflow.com/a/48937052/5977215) – SymbolixAU Oct 11 '18 at 20:53

0 Answers0