X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2FgammaStat.R;h=8035a4ddbb0cfb379ef6b90b0056e658ad138b49;hb=50470fdeb74ae1e235e61ed6acfae81dd51f655c;hp=1c9d9812ee673315f0bafa33baf4070813bac8c2;hpb=c827059eeafc8cbe41c812b26979543ab287803e;p=ape.git diff --git a/R/gammaStat.R b/R/gammaStat.R index 1c9d981..8035a4d 100644 --- a/R/gammaStat.R +++ b/R/gammaStat.R @@ -1,15 +1,15 @@ -## gammaStat.R (2006-10-04) +## gammaStat.R (2009-05-10) ## Gamma-Statistic of Pybus and Harvey -## Copyright 2002-2006 Emmanuel Paradis +## Copyright 2002-2009 Emmanuel Paradis ## This file is part of the R-package `ape'. ## See the file ../COPYING for licensing issues. gammaStat <- 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"') N <- length(phy$tip.label) bt <- sort(branching.times(phy)) g <- rev(c(bt[1], diff(bt))) # internode intervals are from past to present