Compute Euclidean distance from each of a set of points to the nearest detector in an array, or return the sequence number of the detector nearest each point.
1 2 3
traps object or 2-column matrix of coordinates
distancetotrap returns the distance from each point in X to the
nearest detector in
traps. It may be used to restrict the points
on a habitat mask.
For traps objects with polygon detector type (polygon, polygonX), and for SpatialPolygons, the function rgeos::gDistance is used internally if the package rgeos is available (from secr 4.2.0). The method is otherwise approximate and uses only the first polygon.
distancetotrap returns a vector of distances (assumed to be in metres).
nearesttrap returns the index of the nearest trap.
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.