global_hierarchical_clusterer: Global Longevity Clusterer

View source: R/clusterer_farm.R

global_hierarchical_clustererR Documentation

Global Longevity Clusterer

Description

Create a dude to perform hierarchical clustering in a global context using the hclust package.

Usage

global_hierarchical_clusterer(method, dists, cut_height = -1)

Arguments

method

A string to pass to hclust to tell it what kind of clustering to do.

dists

The global distance matrix on which to run clustering to determine a global cutting height.

cut_height

The cutting height at which you want all dendrograms to be cut. If this is not specified then the clusterer will use a cut height 5% above the merge point preceding the tallest branch in the global dendrogram.

Details

This clusterer cuts all dendrograms it is given at a uniform cutting height, defaulting to a heuristic if necessary.

Value

A function that inputs a list of distance matrices and returns a list containing one vector per matrix, whose element names are data point names and whose values are cluster labels (relative to each matrix).

Examples

data = data.frame(x = sapply(1:100, function(x) cos(x)), y = sapply(1:100, function(x) sin(x)))
projx = data$x
names(projx) = row.names(data)

dists = dist(data)

num_bins = 10
percent_overlap = 25

cover = create_width_balanced_cover(min(projx), max(projx), num_bins, percent_overlap)

create_1D_mapper_object(data, dists, projx, cover, global_hierarchical_clusterer("mcquitty", dists))

mappeR documentation built on June 29, 2025, 1:07 a.m.