local_hierarchical_clusterer: Local Longevity Clusterer

View source: R/clusterer_farm.R

local_hierarchical_clustererR Documentation

Local Longevity Clusterer

Description

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

Usage

local_hierarchical_clusterer(method)

Arguments

method

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

Details

This clusterer determines cutting heights for dendrograms by cutting them individually, 5% above the merge point with the longest unbroken gap until the next merge point.

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 (within each patch).

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, local_hierarchical_clusterer("mcquitty"))

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