geo.dist | R Documentation |
Calculates a geographical euclidean distances matrix based on a list of coordinates for samples and for interpolation locations.
geo.dist(from, to)
from |
Data frame with coordinates for source locations. Should have two columns (longitude and latitude). |
to |
Data frame with coordinates for destination locations to where distances are calculated. Should have two columns (longitude and latitude). |
Return the matrix of euclidean distances between source locations ('from') to destination ('to') coordinates. The resulting matrix has source locations in rows and destination in columns and respective names are given based on the row names of the 'from' and 'to' data frames.
Pedro Tarroso <ptarroso@cibio.up.pt>
data(vipers) # create a grid of the sampled area grid <- expand.grid(x=seq(-10,10,0.5), y=seq(30, 50, 0.5)) rd <- geo.dist(vipers[,1:2], grid)