ddist_xy: Calculate dyadic distances between points 'i' and 'j' from...

Description Usage Arguments Value Author(s)

View source: R/ddist_xy.R

Description

This function calculates the geodesic distance between any dyads (pairs of points i and j) from datasets x and y and stores the result in a long tibble

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ddist_xy(
  x = NULL,
  y = NULL,
  ids = NULL,
  coords_x = c("longitude", "latitude"),
  coords_y = c("longitude", "latitude"),
  crs = c(4326, 4326),
  crs_transform = FALSE,
  new_crs = NULL
)

Arguments

x

an object of class data.frame or tibble.

y

an object of class data.frame or tibble.

ids

variables uniquely identifying geospatial points in data x and y. Can be of type numeric, integer, character, or factor

coords_x

names of the numeric coordinate variables in data x. Defaults to c("longitude", "latitude")

coords_y

names of the numeric coordinate variables in data y. Defaults to c("longitude", "latitude")

crs

valid EPSG's for your coordinates in data x and y. Defaults to c(4326, 4326).

crs_transform

a logical value indicating whether to transform the CRS. Defaults to FALSE

new_crs

a valid EPSG for a new CRS. See rgdal::make_EPSG() or https://epsg.org/home.html

Value

a long tibble with dyads and dyadic distances incl. a distance unit indicator

Author(s)

Jeppe Vierø


jvieroe/dyadicdist documentation built on Jan. 21, 2022, 8:43 a.m.