[adegenet-commits] r368 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jun 4 22:30:57 CEST 2009


Author: jombart
Date: 2009-06-04 22:30:57 +0200 (Thu, 04 Jun 2009)
New Revision: 368

Modified:
   pkg/R/haploSim.R
Log:
spatial simulations are now working


Modified: pkg/R/haploSim.R
===================================================================
--- pkg/R/haploSim.R	2009-06-04 19:55:45 UTC (rev 367)
+++ pkg/R/haploSim.R	2009-06-04 20:30:57 UTC (rev 368)
@@ -234,7 +234,7 @@
         res$dates[1] <- 0
         res$ances[1] <- NA
         res$xy <- matrix(xy.gen(), nrow=1)
-        colnames(res$xy) <- xy
+        colnames(res$xy) <- c("x","y")
         toExpand <- TRUE
 
         ## simulations: isn't simplicity beautiful?
@@ -287,9 +287,12 @@
         cat("\n")
 
         cat(paste("$", names(x)[i], sep=""),"\n")
-        if(names(x)[i]!="seq") {
-            cat(head(x[[i]],10), ifelse(length(x[[i]])>10,"...",""),"\n")
-        } else print(x[[i]])
+        if(names(x)[i]=="seq") {
+            print(x[[i]])
+        } else if(names(x)[i]=="xy"){
+            print(head(x[[i]]))
+            if(nrow(x[[i]]>6)) cat("    ...\n")
+        } else cat(head(x[[i]],6), ifelse(length(x[[i]])>6,"...",""),"\n")
     }
 
 



More information about the adegenet-commits mailing list