Learn R Programming

pintervals (version 1.0.1)

Dm_finder: 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")
)

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.

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.