]> git.donarmstrong.com Git - ape.git/blobdiff - R/is.ultrametric.R
new mixedFontLabel() + bug fix in rTraitCont.c
[ape.git] / R / is.ultrametric.R
index 476c229c0d46045dafa53e94e176d2d0bec4bc4b..ae4c43937ea6f08ea6a8cae0afcf7d40a684195a 100644 (file)
@@ -1,19 +1,19 @@
-## is.ultrametric.R (2007-12-18)
+## is.ultrametric.R (2009-05-10)
 
 ##   Test if a Tree is Ultrametric
 
-## Copyright 2003-2007 Emmanuel Paradis
+## Copyright 2003-2009 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
 
 is.ultrametric <- function(phy, tol = .Machine$double.eps^0.5)
 {
-### the tree must be in cladewise order
-    if (class(phy) != "phylo")
+    if (!inherits(phy, "phylo"))
       stop('object "phy" is not of class "phylo".')
     if (is.null(phy$edge.length))
       stop("the tree has no branch lengths.")
+    phy <- reorder(phy)
     n <- length(phy$tip.label)
     n.node <- phy$Nnode