Learn R Programming

ClassDiscovery (version 3.4.0)

cluster3: Cluster a Dataset Three Ways

Description

Produces and plots dendrograms using three similarity measures: Euclidean distance, Pearson correlation, and Manhattan distance on dichotomized data.

Usage

cluster3(data, eps=logb(1, 2), name="", labels=dimnames(data)[[2]])

Arguments

data

A matrix, numeric data.frame, or ExpressionSet object.

eps

A numerical value; the threshold at which to dichotomize the data

name

A character string to label the plots

labels

A vector of character strings used to label the items in the dendrograms.

Value

Invisibly returns the data object on which it was invoked.

See Also

hclust

Examples

Run this code
# NOT RUN {
## simulate data from two different classes
d1 <- matrix(rnorm(100*30, rnorm(100, 0.5)), nrow=100, ncol=30, byrow=FALSE)
d2 <- matrix(rnorm(100*20, rnorm(100, 0.5)), nrow=100, ncol=20, byrow=FALSE)
dd <- cbind(d1, d2)
## cluster it 3 ways
par(mfrow=c(2,2))
cluster3(dd)
par(mfrow=c(1,1))
# }

Run the code above in your browser using DataLab