[R] possible bug in ape::extract.clade()

Dylan Beaudette debeaudette at ucdavis.edu
Mon Jul 19 22:54:44 CEST 2010


Hi,

I was recently splitting some massive phylo class objects with extract.clade() 
and noticed what appears to be a bug in how tip labels are copied from the 
full tree to the pruned tree. This possible bug was also mentioned here:

http://www.mail-archive.com/r-sig-phylo@r-project.org/msg00537.html

An example:

library(ape)
set.seed(5)
x <- matrix(rnorm(100), ncol=10)

p <- as.phylo(hclust(dist(x)))
p.new <- extract.clade(p, 14)

par(mfcol=c(1,2), mar=c(1,1,5,1))
plot(p)
title('original')
nodelabels()

plot(p.new)
title('cut at node 14')


I have noticed that this error is present only sometimes... i.e. when I use a 
different seed for the random matrix 'x', the results are correct in some 
cases.

Any ideas?

Thanks for the very useful 'ape' package!

Cheers,
Dylan




-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341



More information about the R-help mailing list