expandMOC: Expand matrix of clusters

Description Usage Arguments Value Author(s) Examples

View source: R/expand-moc.R

Description

Expand matrix of cluster labels into matrix of clusters

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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

coca documentation built on July 8, 2020, 7:29 p.m.