hca {hclusteasy}R Documentation

Generate and Select Groups with Hierarchical Clustering

Description

Perform hierarchical clustering and generate groups based on sample dissimilarity using the Euclidean method.

Usage

hca(data, method = "complete", num.groups = 3)

Arguments

data

Dataset in data.frame format.

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.

Value

A vector of integers, where each element represents the group assigned to each observation in the original dataset.

Examples

# 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)


[Package hclusteasy version 0.1.0 Index]