R/03-HCSP.R

Defines functions HCSP

Documented in HCSP

### Copyright (C) Kevin R. Coombes, 2024

HCSP <- function(dis, K, method = "ward.D2", ...) {
  if (!inherits(dis, "dist")) {
    dis <- dist(dis) # defaults to Euclidean
  }
  hc <- hclust(dis, method = method)
  sp <- SillyPutty(cutree(hc, k = K, ...), dis)
  list(hc = hc, sp = sp)
}

Try the SillyPutty package in your browser

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

SillyPutty documentation built on Feb. 8, 2024, 3 a.m.