]> git.donarmstrong.com Git - ape.git/blobdiff - man/boot.phylo.Rd
fix bug in prop.clades
[ape.git] / man / boot.phylo.Rd
index fcbf1f3c4f5f7443ca35f7298b7186dc61202cc5..2e166656c4e858f6ccca93f7f57a49a854828eaf 100644 (file)
@@ -90,6 +90,10 @@ prop.clades(phy, ..., part = NULL, rooted = FALSE)
   passed as \code{\dots} fulfills conditions (i) and (ii) above, then it
   might be faster to first call, e.g., \code{pp <- prop.part(...)}, then
   use the option \code{part}: \code{prop.clades(phy, part = pp)}.
+
+  You have to be careful that by default \code{prop.clades} considers
+  the trees as unrooted and this may result in spurious results if the
+  trees are rooted (see examples).
 }
 \value{
   \code{prop.part} returns an object of class \code{"prop.part"} which
@@ -129,15 +133,22 @@ tr <- f(woodmouse)
 for (i in 1:5)
   print(boot.phylo(tr, woodmouse, f, quiet = TRUE))
 ### How many partitions in 100 random trees of 10 labels?...
-TR <- replicate(100, rtree(10), FALSE)
+TR <- rmtree(100, 10)
 pp10 <- prop.part(TR)
 length(pp10)
 ### ... and in 100 random trees of 20 labels?
-TR <- replicate(100, rtree(20), FALSE)
+TR <- rmtree(100, 20)
 pp20 <- prop.part(TR)
 length(pp20)
 plot(pp10, pch = "x", col = 2)
 plot(pp20, pch = "x", col = 2)
+
+set.seed(1)
+tr <- rtree(10) # rooted by default
+prop.clades(tr, tr) # clearly wrong
+prop.clades(tr, tr, rooted = TRUE)
+tr <- rtree(10, rooted = FALSE)
+prop.clades(tr, tr) # correct
 }
 \keyword{manip}
 \keyword{htest}