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")
}
Run the code above in your browser using DataLab