hca | R Documentation |
Perform hierarchical clustering and generate groups based on sample dissimilarity using the Euclidean method.
hca(data, method = "complete", num.groups = 3)
data |
Dataset in |
method |
Method of hierarchical clustering, considering: "ward.D", "ward.D2", "single", "complete", "average" (UPGMA), "mcquitty" (WPGMA), "median" (WPGMC) or "centroid" (UPGMC). Default is "complete". |
num.groups |
Number of groups to cut. Default is three. |
A vector of integers, where each element represents the group assigned to each observation in the original dataset.
# Load the required package
library(hclusteasy)
# Read the 'iris' dataset from the package
data("iris_uci")
# Remove column 'Species' from the iris dataset
iris <- iris_uci[, -5]
# Apply hierarchical cluster and selecting groups
g <- hca(iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.