calc.dist {sesem} | R Documentation |
Calculate intersample distances for a set of X-Y coordinates
Description
calc.dist calculates and stores the distance matrix for all X-Y pairs. It works on a dataset where the first two columns are x and y coordinates
Usage
calc.dist(datafile)
Arguments
datafile |
a dataset where the first two columns are x and y coordinates. Further columns can contain observed variables for subsequent modeling; these are ignored here. |
Details
datafile is a dataset where the first two columns are x and y coordinates. If data are distributed on only one dimension (i.e. along a linear transect) one of the columns should contain zeroes.
Value
a vector containing distances between each pair of samples in the input data
Author(s)
Kerrie Mengersen, Eric Lamb
References
Lamb, E. G., K. Mengersen, K. J. Stewart, U. Attanayake, and S. D. Siciliano. 2014. Spatially explicit structural equation modeling. Ecology 95:2434-2442.
See Also
Examples
data=truelove
distdata<-truelove[c(1:60),]
distances<-calc.dist(distdata)
distances