powered by
Given a set of locations, this function computes the distances between each possible pair of locations.
pdist(x, y, geo = FALSE)
A square matrix representing pairwise distances between each possible pair of locations.
A vector of x (or longitude) coordinates.
A vector of y (or latitude) coordinates.
A logical value indicating whether the locations are defined by geographic coordinates (pairs of longitude/latitude values). Default: FALSE.
Simon Garnier, garnier@njit.edu
nn, nnd
nn
nnd
x <- rnorm(25) y <- rnorm(25, sd = 3) pdist(x, y)
Run the code above in your browser using DataLab