coord2dist {prabclus} | R Documentation |
Geographical coordinates to distances
Description
Computes geographical distances from geographical coordinates
Usage
coord2dist(file=NULL, coordmatrix=NULL, cut=NULL,
file.format="degminsec",
output.dist=FALSE, radius=6378.137,
fp=1/298.257223563, neighbors=FALSE)
Arguments
file |
string. A filename for the coordinate file. The file
should have 2, 4 or 6 numeric columns and one row for each location.
See |
coordmatrix |
something that can be coerced into a matrix with
2, 4 or 6 columns. Matrix of coordinates, one row for each
location. See |
cut |
numeric. Only active if |
file.format |
one of
|
output.dist |
logical. If |
radius |
numeric. Radius of the earth in km used in computation (the default is the equatorial radius but this is not the uniquely possible choice). |
fp |
flattening of the earth; the default is from WGS-84. |
neighbors |
logical. If |
Value
If neighbors==TRUE
, a
list with components
distmatrix |
distance matrix between locations. See
|
nblist |
list with a vector for every location containing the
numbers of its neighbors, see |
If neighbors==FALSE
, only the distance matrix.
Author(s)
Christian Hennig christian.hennig@unibo.it https://www.unibo.it/sitoweb/christian.hennig/en
References
German Wikipedia from 29 August 2010: https://de.wikipedia.org/wiki/Orthodrome
See Also
Examples
options(digits=4)
data(veronica)
coord2dist(coordmatrix=veronica.coord[1:20,], cut=20, file.format="decimal2",neighbors=TRUE)