Learn R Programming

ldt (version 0.5.3)

s.cluster.h: Hierarchical Clustering

Description

This function performs hierarchical clustering on a group of variables, given their distances from each other.

Usage

s.cluster.h(distances, linkage = "single")

Value

A list with the following items:

merge

An integer matrix representing the merge matrix.

height

A numeric vector representing the heights.

order

An integer vector representing the orders.

Arguments

distances

Lower triangle of a symmetric distance matrix (without the diagonal). This can be the output of s.distance function.

linkage

Character string specifying the method for calculating the distance in a left-right node merge. It can be single, complete, uAverage, wAverage, or ward.

Details

The main purpose of exporting this statistics helper method is to show the inner calculations of the package.

Examples

Run this code
n <- 10
data <- data.frame(x = rnorm(n), y = rnorm(n), z = rnorm(n))
distances <- s.distance(data)
clusters <- s.cluster.h(distances)

Run the code above in your browser using DataLab