X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Fsummary.phylo.R;h=592050cfe844731d5212f4fd05d05ea76ba91a48;hb=4ceef408de61dc86f0a93b0396aecc6e30cc0d70;hp=54c2eaa51e3f30f317adadc7a135c4f8fd9b1f34;hpb=0d199dba8a3608f86e89673cc4623755a3ff5a72;p=ape.git diff --git a/R/summary.phylo.R b/R/summary.phylo.R index 54c2eaa..592050c 100644 --- a/R/summary.phylo.R +++ b/R/summary.phylo.R @@ -1,31 +1,31 @@ -## summary.phylo.R (2008-04-22) +## summary.phylo.R (2009-05-10) ## Print Summary of a Phylogeny -## Copyright 2003-2008 Emmanuel Paradis, and 2006 Ben Bolker +## Copyright 2003-2009 Emmanuel Paradis, and 2006 Ben Bolker ## This file is part of the R-package `ape'. ## See the file ../COPYING for licensing issues. Ntip <- 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"') length(phy$tip.label) } Nnode <- function(phy, internal.only = TRUE) { - if (class(phy) != "phylo") - stop('object "phy" is not of class "phylo"') + if (!inherits(phy, "phylo")) + stop('object "phy" is not of class "phylo"') if (internal.only) return(phy$Nnode) phy$Nnode + length(phy$tip.label) } Nedge <- 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"') dim(phy$edge)[1] } @@ -134,9 +134,10 @@ print.multiPhylo <- function(x, details = FALSE, ...) "[.multiPhylo" <- function(x, i) { + oc <- oldClass(x) class(x) <- NULL structure(x[i], TipLabel = attr(x, "TipLabel"), - class = "multiPhylo") + class = oc) } str.multiPhylo <- function(object, ...)