[adegenet-commits] r335 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 28 16:56:01 CEST 2009


Author: jombart
Date: 2009-05-28 16:56:01 +0200 (Thu, 28 May 2009)
New Revision: 335

Modified:
   pkg/R/seqTrack.R
Log:
Some tweaks to optimize procedure with missing data. 
Seems ok but have to give it a try.


Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R	2009-05-28 14:52:48 UTC (rev 334)
+++ pkg/R/seqTrack.R	2009-05-28 14:56:01 UTC (rev 335)
@@ -465,12 +465,12 @@
         if(is.null(argList$dateMin) & identical(rMissDate, .rUnifTimeSeq)){ # earliest date
             argList$dateMin <- min(seq.dates,na.rm=TRUE)
         } else {
-            argList$dateMin[is.na(argList$dateMin)] <- min(seq.dates,na.rm=TRUE) - RANGE.DATES*0.5
+            argList$dateMin[is.na(argList$dateMin)] <- min(seq.dates,na.rm=TRUE)
         }
-        if(is.null(argList$dateMax) & identical(rMissDate, runif)){ # latest date
+        if(is.null(argList$dateMax) & identical(rMissDate, .rUnifTimeSeq)){ # latest date
             argList$dateMax <- max(seq.dates,na.rm=TRUE)
         } else {
-            argList$dateMax[is.na(argList$dateMax)] <- max(seq.dates,na.rm=TRUE) + RANGE.DATES*0.5
+            argList$dateMax[is.na(argList$dateMax)] <- max(seq.dates,na.rm=TRUE)
         }
 
         argList$n <- sum(isMissDate)
@@ -482,8 +482,7 @@
             myDates[!isMissDate] <- myDates[!isMissDate] +
                 .rTimeSeq(n=NB.DATES.TO.SIM, mu0=mu0, L=seq.length, maxNbDays=2*RANGE.DATES)
             ## distribution for missing dates
-            myDates[isMissDate] <-  min(seq.dates,na.rm=TRUE) +
-                do.call(rMissDate, argList) * 24*3600
+            myDates[isMissDate] <- do.call(rMissDate, argList)
 
             res.new <- seqTrack(seq.names=seq.names, seq.dates=myDates, W=W, optim=optim, proxMat=proxMat, ...)
 



More information about the adegenet-commits mailing list