R/supported_dist.methods.R

Defines functions supported_dist.methods

Documented in supported_dist.methods

#' @title Supported Distance Methods
#'
#' @description Lists all choices of a distance method currently supported in \code{hclust1d} via \code{stats::dist} call.
#'
#' @return A character vector with currently supported distance methods.
#'
#' @examples
#'
#' if ("minkowski" %in% supported_dist.methods()) {    # the condition under if evaluates to TRUE
#'    dendrogram <- hclust1d(dist(rnorm(100), method = "minkowski", p = 3))
#'    plot(dendrogram)
#' } else {
#'    stop("Error: minkowski distance method not supported in hclust1d")
#' }
#'
#' @export
supported_dist.methods <- function() c("euclidean", "maximum", "manhattan", "minkowski")

Try the hclust1d package in your browser

Any scripts or data that you put into this service are public.

hclust1d documentation built on Aug. 7, 2023, 5:12 p.m.