X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2FCheverud.R;h=6b70a12bf193d11932a9c35a506e05eab0de9637;hb=3ad385892d75db5c646c92f0f631ae9c5e3da4f6;hp=ab7e24bb4eab18726bccab3ee5cc6c4da549c433;hpb=507aa18c4e3f9312efcb07b90766df1158a39402;p=ape.git diff --git a/R/Cheverud.R b/R/Cheverud.R index ab7e24b..6b70a12 100644 --- a/R/Cheverud.R +++ b/R/Cheverud.R @@ -12,7 +12,9 @@ # Evolution 55(11): 2143-2160 compar.cheverud <- function(y, W, tolerance=1e-6, gold.tol=1e-4) { - W <- W - diag(W) # ensure diagonal is zero + ## fix by Michael Phelan + diag(W) <- 0 # ensure diagonal is zero + ## end of fix y <- as.matrix(y) if(dim(y)[2] != 1) stop("Error: y must be a single column vector.") D <- solve(diag(apply(t(W),2,sum)))