cluster_fast_label: cluster_fast_label

View source: R/cluster_fast.R

cluster_fast_labelR Documentation

cluster_fast_label

Description

Label connected components of a logical matrix using four-connectivity.

Usage

cluster_fast_label(mask)

Arguments

mask

logical matrix

Details

Implemented by run-length encoding each row and then joining runs that overlap in adjacent rows, rather than visiting every cell. The number of runs is typically orders of magnitude smaller than the number of cells, which matters because cluster-extent inference has to repeat this for every permutation.

Value

a list with the integer label matrix and the number of clusters


dendroTools documentation built on Nov. 23, 2026, 9:07 a.m.