0

While trying to calculate distances between points using

distm(FareStageMatrix, LSOACentroidMatrix, fun=distHaversine)

I am getting an error

Error: cannot allocate vector of size 2453.7 Gb

I have around 800,000 records

What is the best way to divide the two matrices and then join everything back together?

I have now managed to compute it for first 10,000 records. How to automatize the process, i.e. I'm using

dist1 <- distm(FareStageMatrix[1:10000,], LSOACentroidMatrix[1:10000,], fun=distHaversine)
  • You can calculate on subsets of indexes. Making a grid with several evaluations like the first one you did. – Clemsang Mar 05 '19 at 14:03
  • I believe [this guy](https://stackoverflow.com/a/54971954/6574038) had a similar issue to yours. – jay.sf Mar 05 '19 at 15:22

0 Answers0