hclust.vector
focused on table of frequencies.hclustvfreq(data, freq = NULL, method = "single", metric = "euclidean",
p = NULL).hclustvfreq(tfq, method = "single", metric = "euclidean", p = NULL)
single
", "ward
", "centroid
" or "median
"."euclidean"
, "maximum"
, "manhattan"
, "canberra"
, "binary"
or "minkowski"
hclust.vector
to be used with tables of frequencies. It use the frequency weights as parameter members
.hclust.vector
, link{tablefreq}
library(dplyr)
library(fastcluster)
data <- iris[,1:3,drop=FALSE]
hc <- hclustvfreq(data, method="centroid",metric="euclidean")
cutree(hc,3) ## Different length than data
tfq <- tablefreq(iris[,1:3])
hc <- .hclustvfreq(tfq, method="centroid",metric="euclidean")
tfq$group <- cutree(hc,3)
Run the code above in your browser using DataLab