get_geodist: Get a matrix of geographic distances for circle_gd
Description
Create a distance matrix based on coordinates and a raster layer.
The output is a distance matrix where rows represent cells on the landscape
and columns represent individual locations on the landscape. Each value is
the geographic distance between each individual and each cell calculated
using st_distance. This matrix is used by circle_gd.
If coords_only = TRUE, the result is a distance matrix for the sample coordinates
only.
coordinates of samples as sf points, a two-column matrix, or a data.frame representing x and y coordinates (see Details for important information about projections)
lyr
SpatRaster or RasterLayer for generating distances (not required if coords_only = TRUE)
fact
aggregation factor to apply to lyr (defaults to 0; note: increasing this value reduces computational time)
coords_only
whether to return distances only for sample coordinates