Function to find the minimum distance between a class and a set of clusters
Dm_finder(
ncs,
class_vec,
class,
clusters,
return = c("min", "which.min", "vec")
)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.
Vector of non-conformity scores
Vector of class labels
Class label to compare against the clusters
List of clusters
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.