dist_matrix: Calculate a distance matrix for a data frame of coordinates

View source: R/balance_check.R

dist_matrixR Documentation

Calculate a distance matrix for a data frame of coordinates

Description

Given a data frame containing X and Y Cartesian coordinates, calculate a distance matrix between the points.

Usage

dist_matrix(dataframe, x_var, y_var)

Arguments

dataframe

A data frame. Must contain numeric variables corresponding to x_var and y_var containing the X and Y coordinate values.

x_var

Character string. The name of the variable in dataframe containing the X components of the coordinates.

y_var

Character string. The name of the variable in dataframe containing the Y components of the coordinates.

Value

A matrix of the distances between the points.


nstauffer/sample.design documentation built on May 9, 2022, 3:21 a.m.