expandMOC {coca} | R Documentation |
Expand matrix of clusters
Description
Expand matrix of cluster labels into matrix of clusters
Usage
expandMOC(clLabels, datasetNames = NULL)
Arguments
clLabels |
Matrix of cluster labels of size N x M. |
datasetNames |
Vector of cluster names of length M. Default is NULL. |
Value
The output is a list containing:
moc |
the matrix of clusters. |
datasetIndicator |
a vector containing the dataset indicator. |
datasetNames |
an expanded vector of dataset names for the moc. |
Author(s)
Alessandra Cabassi alessandra.cabassi@mrc-bsu.cam.ac.uk
Examples
# Load data
data <- list()
data[[1]] <- as.matrix(read.csv(system.file("extdata", "dataset1.csv",
package = "coca"), row.names = 1))
data[[2]] <- as.matrix(read.csv(system.file("extdata", "dataset2.csv",
package = "coca"), row.names = 1))
data[[3]] <- as.matrix(read.csv(system.file("extdata", "dataset3.csv",
package = "coca"), row.names = 1))
# Build matrix of clusters
outputBuildMOC <- buildMOC(data, M = 3, K = 6, distances = "cor")
# Extract matrix of clusters
clLabels <- outputBuildMOC$clLabels
# Impute missing values
outputFillMOC <- fillMOC(clLabels, data = data)
# Replace matrix of cluster labels with new (full) one
clLabels <- outputFillMOC$fullClLabels
# Expand matrix of cluster labels into matrix of clusters
outputExpandMOC <- expandMOC(clLabels)
clLabels <- outputExpandMOC$clLabels
[Package coca version 1.1.0 Index]