point2DIST: Make a distance matrix

View source: R/point2DIST.R

point2DISTR Documentation

Make a distance matrix

Description

Make a distance matrix

Usage

point2DIST(
  dta,
  miles = FALSE,
  proj4string = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs "
)

Arguments

dta

This is a dataframe. Columns of interest must be named: Site, Lat (for latitude), Lon (for longitude).

miles

TRUE/FALSE. whether or not to calculate distance in miles. if FALSE, then estimates in kilometres

proj4string

sp projection for latitude longitude

Value

A distance matrix in kilometres between all pairs sites

Examples

dta <- data.frame(Site= LETTERS[1:4], Lat= 1:4, Lon= 5:8, Pop=100:103)
point2DIST(dta)


KiranLDA/migflow documentation built on June 14, 2025, 9:09 a.m.