Combine algorithms
Combines results for multiple objects from consensus_cluster()
and outputs
either the consensus matrices or consensus classes for all algorithms.
consensus_combine(..., element = c("matrix", "class"))
... |
any number of objects outputted from |
element |
either "matrix" or "class" to extract the consensus matrix or consensus class, respectively. |
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.
consensus_combine
returns either a list of all consensus matrices
or a data frame showing all the consensus classes
Derek Chiu
# 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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.