mergeToMatrix: Get the clusterTree from the result of...

Description Usage Arguments Value Examples

Description

Get the clusterTree from the result of (single/average/complete) linkage clustering.

Usage

1

Arguments

merge

The n-1 by 2 matrix that is the merge component output from a hierarchical clustering which describes how the n points are merged in the cluster hierarchy.

Value

A matrix which represent the clustering result. This matrix is a n by nlevels matrix where each row corresponds to a data point and each column identifies a cluster number for that data point in the hierarchy.

Examples

1
2
3
4
5
6
7
data <- rbind(matrix(rnorm(100, mean = 10, sd = 2), nrow = 50),
              matrix(rnorm(100, mean = 0, sd = 1), nrow = 50),
              matrix(rnorm(100, mean = -10, sd = 3), nrow = 50)
              )
              
clust <- stats::hclust(dist(data),method='single')
mergeToMatrix(clust$merge)

rwoldford/trec documentation built on May 15, 2019, 6:29 p.m.