Learn R Programming

MantelCorr (version 1.42.0)

GetClusters: Over-Partition a (p x n) Data Matrix using 'kmeans'

Description

'GetClusters' uses an overly large k with the 'kmeans' function to over-partition p variables (rows = genes) from n objects (cols = samples) from a given data matrix 'x.data'

Usage

GetClusters(x.data, num.k, num.iters)

Arguments

x.data
p x n data matrix of numeric values
num.k
number of k partitions desired
num.iters
number of iterations - recommend >= 100

Value

'GetClusters' returns a list with the following components:
clusters
cluster assignment from 'kmeans'
cluster.sizes
size of each cluster k from 'kmeans'

See Also

'kmeans'

Examples

Run this code

# simulate a p x n microarray expression dataset, where p = genes and n = samples
data.sep <- rbind(matrix(rnorm(1000), ncol=50), matrix(rnorm(1000, mean=5), ncol=50))
noise <- matrix(runif(40000), ncol=1000)
data <- t(cbind(data.sep, noise))
data <- data[1:200, ]
# data has p = 1,050 genes and n = 40 samples

clusters.result <- GetClusters(data, 100, 100)

Run the code above in your browser using DataLab