Dm_finder: Function to Find the Minimum Distance Between a Class and a...

View source: R/helpers.R

Dm_finderR Documentation

Function to Find the Minimum Distance Between a Class and a Set of Clusters

Description

Function to Find the Minimum Distance Between a Class and a Set of Clusters

Usage

Dm_finder(
  ncs,
  class_vec,
  class,
  clusters,
  return = c("min", "which.min", "vec")
)

Arguments

ncs

Vector of non-conformity scores

class_vec

Vector of class labels

class

Class label to compare against the clusters

clusters

List of clusters

return

Character string indicating what to return. Options are 'min' for the minimum distance, 'which.min' for the index of the cluster with the minimum distance, or 'vec' for a vector of distances to each cluster.

Value

A numeric value or vector depending on the value of the ‘return' parameter. If 'return' is ’min', returns the minimum distance. If ‘return' is ’which.min', returns the index of the cluster with the minimum distance. If ‘return' is ’vec', returns a vector of distances to each cluster.


pintervals documentation built on March 3, 2026, 5:06 p.m.