[adegenet-commits] r389 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 10 12:59:13 CEST 2009


Author: jombart
Date: 2009-06-10 12:59:13 +0200 (Wed, 10 Jun 2009)
New Revision: 389

Modified:
   pkg/R/haploSim.R
Log:
sample.haploSim seems to be ok.


Modified: pkg/R/haploSim.R
===================================================================
--- pkg/R/haploSim.R	2009-06-09 18:30:23 UTC (rev 388)
+++ pkg/R/haploSim.R	2009-06-10 10:59:13 UTC (rev 389)
@@ -275,6 +275,9 @@
     cat("\nHaplotype length :", ncol(x$seq),"nucleotids")
     cat("\nProportion of NA ancestors :", signif(mean(is.na(x$ances)),5))
     cat("\nNumber of known ancestors :", sum(!is.na(x$ances)))
+    cat("\nDate range :", min(x$dates,na.rm=TRUE),"-",max(x$dates,na.rm=TRUE))
+    ##nUniqSeq <- length(unique(apply(as.character(x$seq),1,paste,collapse="")))
+    ##cat("\nNumber of unique haplotypes :", nUniqSeq)
 
     cat("\n\n= Content =")
     for(i in 1:length(x)){
@@ -474,10 +477,6 @@
 
 
 
-
-
-
-
 ###################
 ## sample.haploSim
 ###################
@@ -501,7 +500,7 @@
     }
 
     truedates <- res$dates
-    daterange <- range(res$dates,na.rm=TRUE)
+    daterange <- diff(range(res$dates,na.rm=TRUE))
 
     sampdates <- .rTimeSeq(mu0=mu0, L=L, n=length(truedates), maxNbDays=daterange/2)
     sampdates <- truedates + abs(sampdates)



More information about the adegenet-commits mailing list