[adegenet-commits] r430 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 1 12:49:49 CEST 2009


Author: jombart
Date: 2009-09-01 12:49:49 +0200 (Tue, 01 Sep 2009)
New Revision: 430

Modified:
   pkg/R/sequences.R
Log:
Small fix to remove a warning in transiProb.


Modified: pkg/R/sequences.R
===================================================================
--- pkg/R/sequences.R	2009-09-01 10:32:28 UTC (rev 429)
+++ pkg/R/sequences.R	2009-09-01 10:49:49 UTC (rev 430)
@@ -79,7 +79,7 @@
 ## transiProb
 ###############
 ##
-## distance based on transition prob from one sequence to another
+## proba/distance based on transition prob from one sequence to another
 ## time is taken into account
 ## output: matrix with term proba(rowIdx to colIdx)
 ##
@@ -113,6 +113,7 @@
     ## compute proba(no change @ a site) term
     mu <- mu/365 # express mu per day
     p1 <- exp(-T*mu) + (1-exp(-T*mu))/4
+    p1[toSetToNull] <- 0
     res <- dbinom(D, size=seq.length, prob=(1-p1))
 
     ## PROCESS/RETURN RESULT



More information about the adegenet-commits mailing list