| cluster | R Documentation |
Performs hierarchical cluster analysis on a distance matrix generated by the dist() function. This function reads the distance matrix and item names from the DIST output files and creates a dendrogram.
cluster(notu, method = "average")
notu |
Number of operational taxonomic units (items) in the dataset. |
method |
The agglomeration method to be used. This should be one of "ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC). Default is "average". |
Invisibly returns a list with the following components:
The hclust object produced by
hclust, which can be further processed or plotted
by the user.
The cophenetic correlation coefficient (a single numeric value between -1 and 1) measuring how faithfully the dendrogram represents the original distance matrix. Values closer to 1 indicate a better fit.
The dist object representing the input distance
matrix.
# Requires the CONFOR and DIST executables on the PATH.
try({
delta <- load_delta(
system.file("extdata", "chars_viola", package = "RDelta"),
system.file("extdata", "items_viola", package = "RDelta"),
system.file("extdata", "specs_viola", package = "RDelta")
)
dist(delta)
res <- cluster(delta$get_items_nb())
res$cophenetic
res <- cluster(delta$get_items_nb(), method = "complete")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.