iterative_dist_remove: iteratively remove objects from a distance matrix and plot at...

Description Usage Arguments Value Examples

View source: R/new_functions.R

Description

iteratively remove objects from a distance matrix and plot at each iteration

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
iterative_dist_remove(
  in_dist,
  trymax = 50,
  iterations = 20,
  maxit = 1000,
  exclusion_prob = 0.95,
  parallel = 8,
  targ_pat = "SX",
  rem_type = "total",
  run_nmds = FALSE
)

Arguments

in_dist

input distance matrix, must be type dist

trymax

passed to metaMDS function

iterations

number of removal iterations to try

maxit

passed to metaMDS function

exclusion_prob

passed to quantile(), all observations with cumulative distances to targets (or total) above this quantile will be removed each iteration

parallel

passed to metaMDS function

targ_pat

passed to grep, defines the targets you are interested in (ones you dont want to remove). Only used for rem_type = 'cum_targ' and 'min'

rem_type

one of 'total', 'cum_targ', and 'min'. Specifies how to calculate distances for removal. total will pass cumulative distances to quantile, meaning the objects with the greatest cumulative distance from all other objects will be removed first. 'cum_targ' considers cumulative distances to objects selected by your targ_pat parameter, objects with greatest cumulative distances to your targets will be removed first. min considers the minimum distance to your targets, that is, the distance from each object to the closest target. probably a good choice if your targets are similar to each other and you want to keep all objects that are very similar to any of your targets.

run_nmds

should nmds be run?

Value

returns a big ol list

Examples

1
#soon

Jtrachsel/funfuns documentation built on Aug. 8, 2021, 7:31 p.m.