ConsensusClustering: Consensus Clustering

View source: R/ConsensusClustering.R

ConsensusClusteringR Documentation

Consensus Clustering

Description

Performs consensus clustering using the ConsensusClusterPlus package. The input may be a data matrix or a symmetric distance matrix.

Usage

ConsensusClustering(
  Data,
  ClusterNo = NULL,
  PlotIt = FALSE,
  PlotConsensus = FALSE,
  ...
)

Arguments

Data

Data set with n observations and d features

ClusterNo

Integer or NULL. Number of clusters to search for. If NULL, the complete object returned by ConsensusClusterPlus() is returned.

PlotIt

Logical. If TRUE, plots the final clustering using ClusterPlotMDS(). Default is FALSE.

PlotConsensus

FALSE, NULL, "png", "pdf", or "pngBMP".

...

Further arguments passed to ConsensusClusterPlus::ConsensusClusterPlus().

Value

If ClusterNo is not NULL, a list with components:

Cls

Numeric vector of cluster assignments.

Object

Complete object returned by ConsensusClusterPlus::ConsensusClusterPlus().

If ClusterNo = NULL, the complete result from ConsensusClusterPlus::ConsensusClusterPlus() is returned directly.

If ConsensusClusterPlus is unavailable, a fallback list is returned with all observations assigned to cluster 1 and an explanatory message in Object.

Author(s)

Michael Thrun

References

Wilkerson, D. M. and Hayes, N. D.: ConsensusClusterPlus: a class discovery tool with confidence assessments and item tracking, Bioinformatics,Vol. 26(12), pp. 1572–1573, 2010.

Examples

# Requires the Bioconductor package ConsensusClusterPlus

# set.seed(1)
# Data <- matrix(rnorm(100), ncol = 5)
#
# result <- ConsensusClustering(
#   Data = Data,
#   ClusterNo = 3,
#   PlotIt = FALSE,
#   reps = 100,
#   clusterAlg = "hc",
#   distance = "euclidean",
#   seed = 123
# )
#
# result$Cls

FCPS documentation built on July 15, 2026, 5:08 p.m.