calc_mean_dist: Calculating the mean distances of each plot in the lineup.

View source: R/opt_diff.r

calc_mean_distR Documentation

Calculating the mean distances of each plot in the lineup.

Description

Distance metric is used to calculate the mean distance between the true plot and all the null plots in a lineup. The mean distances of each null plot to all the other null plots are calculated. The mean distances are returned for all the plots in the lineup.

Usage

calc_mean_dist(lineup.dat, var, met, pos, dist.arg = NULL, m = 20)

Arguments

lineup.dat

lineup data of the lineup

var

a vector of names of the variables to be used to calculate the mean distances

met

distance metric needed to calculate the distance as a character

pos

position of the true plot in the lineup

dist.arg

a list or vector of inputs for the distance metric met; NULL by default

m

number of plots in the lineup, by default m = 20

Value

the mean distances of each plot in the lineup

Examples

if(require('dplyr')){
calc_mean_dist(lineup(null_permute('mpg'), mtcars, pos = 1), var = c('mpg', 'wt'),
met = 'reg_dist', pos = 1, m = 10)}

dicook/nullabor documentation built on July 10, 2022, 12:08 a.m.