dueling.dendrograms {sharpshootR}R Documentation

Dueling Dendrograms

Description

Graphically compare two related dendrograms

Usage

dueling.dendrograms(p.1, p.2, lab.1 = "D1", 
lab.2 = "D2", cex.nodelabels=0.75, arrow.length=0.05)

Arguments

p.1

left-hand phylo-class dendrogram

p.2

right-hand phylo-class dendrogram

lab.1

left-hand title

lab.2

right-hand title

cex.nodelabels

character expansion size for node labels

arrow.length

arrow head size

Details

Connector arrows are used to link nodes from the left-hand dendrogram to the right-hand dendrogram.

Author(s)

D. E. Beaudette

Examples

library(aqp)
library(cluster)
library(ape)

# load sample dataset from aqp package
data(sp3)

# promote to SoilProfileCollection
depths(sp3) <- id ~ top + bottom

# compute dissimilarity using different sets of variables
# note that these are rescaled to the interval [0,1]
d.1 <- profile_compare(sp3, vars=c('clay', 'cec'), k=0, max_d=100, rescale.result=TRUE)
d.2 <- profile_compare(sp3, vars=c('clay', 'L'), k=0, max_d=100, rescale.result=TRUE)

# cluster via divisive hierarchical algorithm
# convert to 'phylo' class
p.1 <- as.phylo(as.hclust(diana(d.1)))
p.2 <- as.phylo(as.hclust(diana(d.2)))

# graphically compare two dendrograms
dueling.dendrograms(p.1, p.2, lab.1='clay and CEC', lab.2='clay and L')

plot of chunk unnamed-chunk-1

# graphically check the results of ladderize() from ape package
dueling.dendrograms(p.1, ladderize(p.1), lab.1='standard', lab.2='ladderized')

plot of chunk unnamed-chunk-1

# sanity-check: compare something to itself
dueling.dendrograms(p.1, p.1, lab.1='same', lab.2='same')

plot of chunk unnamed-chunk-1

# graphically compare diana() to agnes() using d.2
dueling.dendrograms(as.phylo(as.hclust(diana(d.2))), 
as.phylo(as.hclust(agnes(d.2))), lab.1='diana', lab.2='agnes')

plot of chunk unnamed-chunk-1


[Package sharpshootR version 0.8-4 Index]