]> git.donarmstrong.com Git - ape.git/blobdiff - R/gammaStat.R
fix in read.dna and change in write.dna
[ape.git] / R / gammaStat.R
index 1c9d9812ee673315f0bafa33baf4070813bac8c2..8035a4ddbb0cfb379ef6b90b0056e658ad138b49 100644 (file)
@@ -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