matchedClustering: Clustering with Matches

View source: R/matchedClustering.R

matchedClusteringR Documentation

Clustering with Matches

Description

Compute the clustering into ns clusters of elements for which a distance matrix (distMatrix) is given, subject to the constraint that groups of ns elements cannot be inthe same cluster. For example, elements from 1 to ns cannot be in the same cluster, and so it is for elements from ns+1 to 2*ns, 2*ns+1 to 3*ns, and so on.

Usage

matchedClustering(
  distMatrix,
  ns,
  maxMatch = TRUE,
  parallel = FALSE,
  nparallel = 1
)

Arguments

distMatrix

squared distance matrix

ns

number of clusters

maxMatch

if TRUE, use the maximum match (assignament problem), otherwise use a stable matching (which may not be maximum). Maximum means that the match will have minimal sum of distances

parallel

use multi-threading TRUE/FALSE, uses doMC and foreach packages

nparallel

how many threads at a time

Value

returns the clusters assigned to each element (there is an element for each column of distMatrix)

Examples

res.clust <- matchedClustering(distMatrix,10)

Nik-Zainal-Group/signature.tools.lib documentation built on April 13, 2025, 5:50 p.m.