View source: R/matchedClustering.R
matchedClustering | R Documentation |
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.
matchedClustering(
distMatrix,
ns,
maxMatch = TRUE,
parallel = FALSE,
nparallel = 1
)
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 |
returns the clusters assigned to each element (there is an element for each column of distMatrix)
res.clust <- matchedClustering(distMatrix,10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.