consensus_combine {diceR} | R Documentation |
Combine algorithms
Description
Combines results for multiple objects from consensus_cluster()
and outputs
either the consensus matrices or consensus classes for all algorithms.
Usage
consensus_combine(..., element = c("matrix", "class"))
Arguments
... |
any number of objects outputted from |
element |
either "matrix" or "class" to extract the consensus matrix or consensus class, respectively. |
Details
This function is useful for collecting summaries because the original results
from consensus_cluster
were combined to a single object. For example,
setting element = "class"
returns a matrix of consensus cluster
assignments, which can be visualized as a consensus matrix heatmap.
Value
consensus_combine
returns either a list of all consensus matrices
or a data frame showing all the consensus classes
Author(s)
Derek Chiu
Examples
# Consensus clustering for multiple algorithms
set.seed(911)
x <- matrix(rnorm(500), ncol = 10)
CC1 <- consensus_cluster(x, nk = 3:4, reps = 10, algorithms = "ap",
progress = FALSE)
CC2 <- consensus_cluster(x, nk = 3:4, reps = 10, algorithms = "km",
progress = FALSE)
# Combine and return either matrices or classes
y1 <- consensus_combine(CC1, CC2, element = "matrix")
str(y1)
y2 <- consensus_combine(CC1, CC2, element = "class")
str(y2)
[Package diceR version 2.2.0 Index]