augment_user_tested: Nearest wrapper

View source: R/augmenters.R

augment_user_testedR Documentation

Nearest wrapper

Description

This function is wrapper to nearest, adding is_covered to the model. This function is explicit about inputs, and is useful in cross validation - evaluating how test data performs against suggested facilities in the training set. This might be added to nearest, and may become obsolete.

Usage

augment_user_tested(all_facilities, test_data, distance_threshold = 100)

Arguments

all_facilities

data.frame Facilities selected in maxcovr model

test_data

data.frame test data (but it could be any user-type data)

distance_threshold

numeric

Value

dataframe containing distances between each test data observation and the nearest facility.

Examples


## Not run: 

mc_cv_relocate_n100_cut |>
  mutate(user_nearest_test = map2(
    .x = facilities_selected,
    .y = test,
    .f = augment_user_tested
    ))


## End(Not run)


njtierney/maxcovr documentation built on Nov. 27, 2024, 7:51 a.m.