Learn R Programming

hit (version 0.4.0)

as.hierarchy: Hierarchy Structure

Description

Stores variable indexes of clustering hierarchies in a fast accessible manner.

Usage

as.hierarchy(x, max.height, height, names, ...)

Arguments

x
A S3 object e.g. from hclust or dendrogram.
max.height
Is the maximal height below the height of the global node which is considered.
height
A vector of heights at which nodes are grouped.
names
Variable names in the order in which the indexes should be assigned to the variables.
...
Further arguments.

Details

For the HIT algorithm it is important to have the hierarchical clustering structure in a fast accessible format. This is provided by the hierarchy object generated with this function.

Examples

Run this code
##
set.seed(123)
n <- 80
p <- 90
# x with correlated columns
corMat <- toeplitz((p:1/p)^3)
corMatQ <- chol(corMat)
x <- matrix(rnorm(n * p), nrow = n) %*% corMatQ
colnames(x) <- paste0("x", 1:p)
# hierarchy
hc <- hclust(dist(t(x)))
hier <- as.hierarchy(hc)

Run the code above in your browser using DataLab