X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Fis.binary.tree.R;h=1bff336d470d00603f61b555ad058c0d6e88e62e;hb=2419de65ffb4f7c45eb8c2448bcba3d0df64744f;hp=54551a07a85438f80c5b11c7589e0e727cbac122;hpb=c827059eeafc8cbe41c812b26979543ab287803e;p=ape.git diff --git a/R/is.binary.tree.R b/R/is.binary.tree.R index 54551a0..1bff336 100644 --- a/R/is.binary.tree.R +++ b/R/is.binary.tree.R @@ -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