]> git.donarmstrong.com Git - ape.git/blobdiff - R/is.binary.tree.R
new mixedFontLabel() + bug fix in rTraitCont.c
[ape.git] / R / is.binary.tree.R
index 54551a07a85438f80c5b11c7589e0e727cbac122..1bff336d470d00603f61b555ad058c0d6e88e62e 100644 (file)
@@ -1,5 +1,5 @@
 ## is.binary.tree.R (2002-09-12) [modified by EP 2005-05-31, 2005-08-18,
-##                                2006-10-04]
+##                                2006-10-04, 2009-05-10]
 
 ##    Tests whether a given phylogenetic tree is binary
 
@@ -10,7 +10,7 @@
 
 is.binary.tree <- function(phy)
 {
-    if (class(phy) != "phylo") stop('object "phy" is not of class "phylo"')
+    if (!inherits(phy, "phylo")) stop('object "phy" is not of class "phylo"')
     ## modified by EP so that it works without edge lengths too (2005-05-31):
     nb.tip <- length(phy$tip.label)
     nb.node <- phy$Nnode