]> git.donarmstrong.com Git - ape.git/blobdiff - R/PGLS.R
some updates (including new CADM.global.Rd file)
[ape.git] / R / PGLS.R
index 510f4017ebb857a51eaba2275d45c3c329deac3f..6b6f4afe05408b8a1885f2ac76aa904edf319234 100644 (file)
--- a/R/PGLS.R
+++ b/R/PGLS.R
@@ -187,8 +187,8 @@ coef.corGrafen <- function(object, unconstrained = TRUE, ...)
 
 compute.brlen <- function(phy, method = "Grafen", power = 1, ...)
 {
-    if (!"phylo" %in% class(phy))
-      stop('object "phy" is not of class "phylo"')
+    if (!inherits(phy, "phylo"))
+        stop('object "phy" is not of class "phylo"')
     Ntip <- length(phy$tip.label)
     Nnode <- phy$Nnode
     Nedge <- dim(phy$edge)[1]