geodist
geodist copied to clipboard
Min/Max Feature
Would it be a viable option there to search for min/max distances? You answered to a tweet of mine and showed geodist, the only problem with it was that it returns the full distance matrix.
If you have quite a large number of points this becomes rather soon a memory issue.
Would it be possible to only store a single number in the loop (e.g. check via ifelse if bigger/smaller each iteration)? One could set this possibly as argument in geodist()
.
Yeah, that would be entirely possible, and would be a nice enhancement. It'd likely be best written as a separate function for maximal efficiency. I'll let you know here when that's done
Re-opened until the georange
function has been documented in the vignette
Neat :-) Just tested it, worked like a charm!
To add on that: would it be within the scope of geodist to also take a three column matrix and return min max for pairwise IDs (third column)? That is something we (landscape ecology) are always interested in and given the lightweight of geodist, the package would be a perfect drop-in replacement for a lot of otherwise large dependencies. :+1:
So you mean that georange
could or should also return the ID values corresponding to the min & max values? Yeah, that would obviously be useful. It would likely be more pragmatic to simply return the position and allow the user to map that back onto desired (ID) column, but that last step would be easy. Good idea - thanks!
I often go through that sequence when providing.metrics to animal tracking stuff, the q comes in "when was it nearest to X?" and then of course where was that, and how far ... so the distance provides the answer after tracing back . :)