X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Fas.phylo.R;h=f5a2569f7577f0236a7d7456d0ac2ab15e21f61e;hb=57c9d4fd10a4449c27c65873eaf9315b5b7ed874;hp=c0304b50493512e69fcf5032265f7222dc185845;hpb=df2d6bcb931ba3b5fa7b327176e5793908d6c8fd;p=ape.git diff --git a/R/as.phylo.R b/R/as.phylo.R index c0304b5..f5a2569 100644 --- a/R/as.phylo.R +++ b/R/as.phylo.R @@ -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))