]> git.donarmstrong.com Git - ape.git/blobdiff - R/as.phylo.R
several fixes
[ape.git] / R / as.phylo.R
index c0304b50493512e69fcf5032265f7222dc185845..f5a2569f7577f0236a7d7456d0ac2ab15e21f61e 100644 (file)
@@ -1,4 +1,4 @@
-## as.phylo.R (2010-11-30)
+## as.phylo.R (2010-12-14)
 
 ##     Conversion Among Tree Objects
 
@@ -88,6 +88,7 @@ as.hclust.phylo <- function(x, ...)
 {
     if (!is.ultrametric(x)) stop("the tree is not ultrametric")
     if (!is.binary.tree(x)) stop("the tree is not binary")
+    if (!is.rooted(x)) stop("the tree is not rooted")
     n <- length(x$tip.label)
     bt <- sort(branching.times(x))
     inode <- as.numeric(names(bt))