[adegenet-commits] r363 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jun 4 15:26:45 CEST 2009
Author: jombart
Date: 2009-06-04 15:26:44 +0200 (Thu, 04 Jun 2009)
New Revision: 363
Modified:
pkg/R/haploSim.R
Log:
Still smthg wrong...
Modified: pkg/R/haploSim.R
===================================================================
--- pkg/R/haploSim.R 2009-06-04 12:32:55 UTC (rev 362)
+++ pkg/R/haploSim.R 2009-06-04 13:26:44 UTC (rev 363)
@@ -80,7 +80,7 @@
if(curSize < max.nb.haplo) return(NULL)
toKeep <- sample(1:curSize, size=max.nb.haplo, replace=FALSE)
removed.strains <- rownames(res$seq)[!toKeep]
- res$seq <<- res$res[toKeep,]
+ res$seq <<- res$seq[toKeep,]
res$date <<- res$date[toKeep]
res$ances <<- res$ances[toKeep]
res$ances[as.character(res$ances) %in% removed.strains] <- NA
@@ -156,16 +156,16 @@
cat("\nSize :", length(x$ances),"haplotypes")
cat("\nHaplotype length :", ncol(x$seq),"nucleotids")
- cat("\nProportion of NA ancestors :", round(mean(is.na(x$ances)),5), "\n")
+ cat("\nProportion of NA ancestors :", signif(mean(is.na(x$ances)),5))
+ cat("\nNumber of known ancestors :", sum(!is.na(x$ances)), "\n")
-
cat("\n= Content =")
for(i in 1:length(x)){
cat("\n")
cat(paste("$", names(x)[i], sep=""),"\n")
if(names(x)[i]!="seq") {
- print(head(x[[i]]))
+ cat(head(x[[i]],10), "...\n")
} else print(x[[i]])
}
More information about the adegenet-commits
mailing list