## 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
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