virtualArrayHclust: Plot a hclust object with colored labels

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

This function takes a hclust object and a vector of colors as its input and plots the hclust object with colored labels.

Usage

1
virtualArrayHclust(hclust, lab = hclust$labels, lab.col = rep(1, length(hclust$labels)), hang = 0.1, ...)

Arguments

hclust

a hclust object

lab

labels to use

lab.col

colors to use for each label

hang

see "hclust"

...

see "hclust"

Details

This function is normally only called by "virtualArray.ExpressionSet".

Value

A modified hclust object is returned.

Note

The function was written by Eva Chan and incorporated into this package by Andreas Heider

Author(s)

Original author: Eva Chan

Modified by: Andreas Heider (2011)

See Also

virtualArray-package, virtualArray.ExpressionSet, virtualArrayCompile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# we use the USArrests dataset 
new.arrests <- USArrests
# now we need to specify a function to create colors
color_me <- function(x){
					if(x >= 100){"red"}
					else{"blue"}
					}
# lets build the colors in relation to the "Assaults" statistic
new.arrests[,5] <- sapply(new.arrests[,2],color_me)
# we need a distence matrix to build our tree
dist1 <- dist(new.arrests[,1:4],method="euclidian")
# and we need a conventional hclust object
hc_nocolor <- hclust(dist1,method="average")
# now we can hook up to that object and change the label colors
# note that this call will automatically plot the tree
virtualArrayHclust(hc_nocolor,lab=rownames(new.arrests),lab.col=new.arrests[,5])

ShixiangWang/arrayConnector documentation built on May 14, 2019, 6:02 a.m.