]> git.donarmstrong.com Git - ape.git/blobdiff - R/dist.topo.R
fixing a few bugs...
[ape.git] / R / dist.topo.R
index f6784a9ab58db123feead3f4bd3da31f103d12ee..04313b43a0a8ae0ad9f37e1e3bc6e8a85ad977d9 100644 (file)
@@ -1,9 +1,9 @@
-## dist.topo.R (2007-07-04)
+## dist.topo.R (2008-02-27)
 
 ##      Topological Distances, Tree Bipartitions,
 ##   Consensus Trees, and Bootstrapping Phylogenies
 
-## Copyright 2005-2007 Emmanuel Paradis
+## Copyright 2005-2008 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -165,12 +165,15 @@ prop.clades <- function(phy, ..., part = NULL)
 boot.phylo <- function(phy, x, FUN, B = 100, block = 1)
 {
     if (is.list(x)) {
-        nm <- names(x)
-        n <- length(x)
-        x <- unlist(x)
-        nL <- length(x)
-        x <- matrix(x, n, nL/n, byrow = TRUE)
-        rownames(x) <- nm
+        if (class(x) == "DNAbin") x <- as.matrix(x)
+        else {
+            nm <- names(x)
+            n <- length(x)
+            x <- unlist(x)
+            nL <- length(x)
+            x <- matrix(x, n, nL/n, byrow = TRUE)
+            rownames(x) <- nm
+        }
     }
     boot.tree <- vector("list", B)
     for (i in 1:B) {