find_preferences: Determine the preference of two sets of points for each other...

View source: R/balance_around.R

find_preferencesR Documentation

Determine the preference of two sets of points for each other based on distance

Description

Given two sf point objects, compare the members of each against all the members of the other, ranking their "preference" for the compared points based on distance. By default this assigns higher preference for points that are closer.

Usage

find_preferences(template_points, comparison_points)

Arguments

template_points

An sf point object. The first set of points to be used in the comparison.

comparison_points

An sf point object. The second set of points to be used in the comparison.

Value

A named list of two data frames: "template" and "comparison". Both data frames contain template_index (the indices of points in template_points) and comparison_index (the indices of points in template_points). Both data frames contain all unique combinations of the two sets of points. "template" contains a variable named "rank_by_template" which is the relative preference of the template point at that index for the comparison point at that index (lower values representing higher preference). "comparison" likewise has "rank_by_comparison" which is the preference of the comparison point for the template point.


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