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