Skip to contents

Converts a similarity matrix to distance 1 - similarity, runs stats::hclust with method = "average" (UPGMA), and cuts the tree at height 1 - threshold so clusters keep average similarity at least threshold. Non-finite similarities are set to 0 before clustering.

Usage

groupSimilarityMatrix_hclustAverage(x, threshold = 0.9)

Arguments

x

numeric square similarity matrix.

threshold

numeric(1). Minimum average similarity within a cluster (cut height 1 - threshold). Default 0.9.

Value

Integer vector of group IDs, length nrow(x).

Details

Available arguments: x, threshold.