Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


LearnClust (version 1.1)

agglomerativeHC: To execute agglomerative hierarchical clusterization algorithm by distance and approach.

Description

To execute complete agglomerative hierarchical clusterization algorithm choosing distance and approach type.

Usage

agglomerativeHC(data, distance, approach)

Arguments

data

could be a numeric vector, a matrix or a numeric data frame. It will be transformed into matrix and list to be used.

distance

is a string. It chooses the distance to use.

approach

is a string. It chooses the approach to use.

Value

R object with a dendrogram, the grouped clusters and the list with every cluster.

Details

This function is the main part of the agglomerative hierarchical clusterization method. It executes the theoretical algorithm step by step.

1 - The function transforms data in useful object to be used.

2 - It creates the clusters.

3 - It calculates a matrix distances with the clusters created applying distance and approach given.

4 - It chooses the distance value and gets the clusters.

5 - It groups the clusters in a new one and updates clusters list.

6 - It repeats these steps until an unique cluster exists.

Examples

Run this code
# NOT RUN {
a <- c(1,2,1,3,1,4,1,5,1,6)

matrixA <- matrix(a,ncol=2)

dataFrameA <- data.frame(matrixA)

agglomerativeHC(a,'EUC','MAX')

agglomerativeHC(matrixA,'MAN','AVG')

agglomerativeHC(dataFrameA,'CAN','MIN')

# }

Run the code above in your browser using DataLab