Description Usage Arguments Value Examples
Returns cluster labels that match the clusters in sequenchr::plot_dendrogram branches left-to-right.
1 | label_clusters(.model, k)
|
.model |
an hclust model |
k |
the number of clusters |
a factor
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(TraMineR)
data(mvad)
seqstatl(mvad[, 17:86])
mvad.alphabet <- c("employment", "FE", "HE", "joblessness", "school",
"training")
mvad.labels <- c("employment", "further education", "higher education",
"joblessness", "school", "training")
mvad.seq <- seqdef(mvad, 17:86, alphabet = mvad.alphabet, # states = mvad.scodes,
labels = mvad.labels, xtstep = 6)
dist_matrix <- TraMineR::seqdist(seqdata = mvad.seq, method = "DHD")
cluster_model <- hclust(d = as.dist(dist_matrix), method = 'ward.D2')
label_clusters(cluster_model, k = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.