plot.best: Plot a dendrogam of a hierarchical cluster with branches...

View source: R/plot.best.R

plot.bestR Documentation

Plot a dendrogam of a hierarchical cluster with branches labeled by their numbers and significance estimates of tightness.

Description

Description: A plot method for the class best.

Usage

## S3 method for class 'best'
plot(x,mystat="fldc",siglevel=0.05,sigtype=c("raw","corrected","fdr"),
        partition=NA,print.num=TRUE,print.lab=TRUE,float=0.01,col.best=c(2,3),
        cex.best=0.8,cex.leaf=0.8,font.best=NULL,main=NULL,sub=NULL,xlab=NULL,
        metric.args=list(),...)

Arguments

x

An object of class best, such as computed by the SigTree function.

mystat

A measure of tightness for which p-values are to be shown in the plot. Default is "fldc". Other options are "fldcc" and "bldc".

siglevel

A threshold level of significance for tightness of branches used when partition=NA. Default is 0.05. If the estimate of significance for a node is below threshold, it will be shown on the plot next to the node.

sigtype

A character string specifying how the significance threshold siglevel should be interpreted. If "raw", the threshold will be applied directly to the p-values tabulated for each tree node in x. With "corrected" chosen, the threshold will be applied to the p-values corrected for multiplicity:
p_cor = 1 - (1 - p)^(N - 2), where N is the number of leaves in the tree. of significance. If "fdr", siglevel is interpreted as a threshold on false discovery rate.

partition

An object of class partition, such as computed by the PartitionTree function.

print.num

Logical. If true, the branch numbers will be indicated.

print.lab

Logical. If true, the labels will be displayed at the bottom of dendrogram.

float

A numeric value that can change the vertical location of pvalues.

col.best

A character vector of length 2, indicating the colors to be used for the p-values and for the numbers of the nodes.

cex.best

A numeric value for the text size of the branch labels.

cex.leaf

A numeric value for the text size of the leaf labels.

font.best

An integer which specifies font choice of text on the plot. See ?par function parameter font for details.

main

A character string specifying the title of the plot.

sub

A character string specifying a subtitle of the plot.

xlab

A caracter string specifying the label of horizontal axis.

metric.args

Additional argument from user supplied dissimilariity(distance) function. See details and examples below for further explanation.

...

Further arguments to be passed on to the plot function.

Details

The function plots a dendrogram of the hierarchical tree as specified by the x argument, an object of class "best". When argument partition is set to an object of class "partition", and a partition does exist (see partition for description), this plot provides the significance estimates for the nodes that form the partition. Otherwise, this function puts legends on all tight nodes with significance estimates no more than siglevel. To obtain the leaves descending from a given node, refer to function LeafContent.

Value

A plot with all branch numbers and significant pvalues in the hierarchical tree.

Author(s)

Guoli Sun, Alex Krasnitz

See Also

SigTree, PartitionTree,best,partition

Examples

## Not run: 
data(leukemia)
mytable<-SigTree(data.matrix(leukemia),mystat="all",
        mymethod="ward",mymetric="euclidean",rand.fun="shuffle.column",
        distrib="Rparallel",njobs=2,Ptail=TRUE,tailmethod="ML")
plot(x=mytable,mystat="fldc",siglevel=0.001,sigtype="raw",hang=-1)
mypartition<-PartitionTree(x=mytable,siglevel=0.001,statname="fldc",
        sigtype="raw")
plot(x=mytable,mystat="fldc",partition=mypartition)
plot(x=mytable,mystat="fldc",partition=mypartition,print.num=F)
#with user-defined functions
mydist<-function(x,y){return(dist(x)/y)}
myrand<-function(x,z){return(apply(x+z,2,sample))}
mytable<-SigTree(data.matrix(leukemia),mystat="fldc",
	mymethod="ward",mymetric="mydist",rand.fun="myrand",
	distrib="Rparallel",njobs=2,Ptail=TRUE,tailmethod="MOM",metric.args=list(3),
	rand.args=list(2))
plot(mytable,metric.args=list(3))
plot(mytable,metric.args=list(3),cex.leaf=1.5)

## End(Not run)

TBEST documentation built on May 25, 2022, 9:11 a.m.

Related to plot.best in TBEST...