geo.dist: Geographical distance matrix for samples and interpolation...

Description Usage Arguments Value Author(s) Examples

View source: R/geo.dist.R

Description

Calculates a geographical euclidean distances matrix based on a list of coordinates for samples and for interpolation locations.

Usage

1
geo.dist(from, to)

Arguments

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).

Value

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.

Author(s)

Pedro Tarroso <ptarroso@cibio.up.pt>

Examples

1
2
3
4
5
6
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)

Example output



phylin documentation built on Dec. 12, 2019, 5:07 p.m.