[adegenet-commits] r524 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 8 15:46:25 CET 2010


Author: jombart
Date: 2010-01-08 15:46:24 +0100 (Fri, 08 Jan 2010)
New Revision: 524

Modified:
   pkg/R/haploSim.R
Log:
Now that's cool: haploSim objects can be translated into graphs, so plotted using Rgraphviz, even though there are no spatial coordinates.


Modified: pkg/R/haploSim.R
===================================================================
--- pkg/R/haploSim.R	2010-01-08 14:34:35 UTC (rev 523)
+++ pkg/R/haploSim.R	2010-01-08 14:46:24 UTC (rev 524)
@@ -554,3 +554,20 @@
 
     return(res)
 } # end sample.haploSim
+
+
+
+
+
+
+
+
+##########################
+## as("haploSim", "graphNEL")
+##########################
+setOldClass("haploSim")
+setAs("haploSim", "graphNEL", def=function(from){
+    N <- length(from$ances)
+    res <- ftM2graphNEL(cbind(from$ances[-1], 2:N))
+    return(res)
+})



More information about the adegenet-commits mailing list