Description Usage Arguments Value Author(s)
View source: R/distance.reproj_pkg.R
This function calculates the distance between island centroids (input) and the nearest polygons. The function iterates through however many centroid points are given, and for each point, reprojects to an azimuthal equidistant projection that is centered around the centroid (see Weigelt and Kreft 2013). Because of the use of a for loop and reprojections, this can be a very slow script.
1 | distance.reproj(pts, polys)
|
pts |
SpatialPointsDataFrame of island centroids. Assumed unprojected lat/long. |
polys |
SpatialPolygonsDataFrame of islands for which you want to calculate distances between centroids and polys. Assumed unprojected lat/long. |
Returns a vector of distances between each of the centroids and the closest island. The vector is in the same order as the centroid input.
Tyler J Tran, tylerjtran@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.