pointDist | R Documentation |
This function calculates a distance matrix between points. It is similar to the dist()
function except that it does its calculations in geographic space.
pointDist(x, y = NULL, distFunct = NULL, longLat = NULL, ...)
x |
A data frame, matrix, |
y |
If |
distFunct |
Either a function or |
longLat |
Two-element character list or two-element integer list. If |
... |
Arguments to pass to |
Matrix of values in units given by the coordinate reference system of x
or in meters (if x
is a matrix, data frame, or unprojected).
distCosine
, pairDist
, distance
set.seed(17) # random points centered on long -90, lat 45 x <- cbind(rnorm(5, -90), rnorm(5, 45)) pointDist(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.