[Adephylo-commits] r161 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Mar 15 17:58:03 CET 2010
Author: jombart
Date: 2010-03-15 17:58:03 +0100 (Mon, 15 Mar 2010)
New Revision: 161
Modified:
pkg/R/distances.R
Log:
NULL branch length no longer causes a seg fault...
Modified: pkg/R/distances.R
===================================================================
--- pkg/R/distances.R 2010-03-14 20:02:16 UTC (rev 160)
+++ pkg/R/distances.R 2010-03-15 16:58:03 UTC (rev 161)
@@ -13,6 +13,9 @@
res <- double(resSize)
method <- match.arg(method)
method <- match(method, c("patristic","nNodes","Abouheif","sumDD"))
+ if(is.null(tre$edge.length)){
+ tre$edge.length <- as.double(rep(1, nrow(tre$edge)))
+ }
temp <- .C("distalltips", as.integer(tre$edge[,1]), as.integer(tre$edge[,2]), as.double(tre$edge.length), nrow(tre$edge), n, res, resSize, as.integer(method), PACKAGE="adephylo")
res <- temp[[6]]
More information about the Adephylo-commits
mailing list