[adegenet-commits] r810 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 18 16:02:09 CET 2011


Author: jombart
Date: 2011-02-18 16:02:09 +0100 (Fri, 18 Feb 2011)
New Revision: 810

Modified:
   pkg/R/SNPbin.R
Log:
cbind works for SNPbin and genlight


Modified: pkg/R/SNPbin.R
===================================================================
--- pkg/R/SNPbin.R	2011-02-17 15:21:33 UTC (rev 809)
+++ pkg/R/SNPbin.R	2011-02-18 15:02:09 UTC (rev 810)
@@ -651,7 +651,7 @@
         res[[i]] <- Reduce(cbind, lapply(myList, function(e) e at gen[[i]]))
     }
 
-    res <- new("genlight",temp)
+    res <- new("genlight",res)
 
     ## handle loc.names, alleles, etc. ##
     locNames(res) <- unlist(lapply(myList, locNames))
@@ -903,3 +903,13 @@
 
 ## ## time taken by subsetting (quite long, +- 35sec)
 ## system.time(y <- x[1:10, 1:5e5])
+
+
+
+## c, cbind, rbind:
+## a <- new("genlight", list(c(1,0,1), c(0,0,1,0)) )
+## b <- new("genlight", list(c(1,0,1,1,1,1), c(1,0)) )
+## locNames(a) <- letters[1:4]
+## locNames(b) <- 1:6
+## c <- cbind(a,b)
+## identical(as.matrix(c),cbind(as.matrix(a), as.matrix(b))) # MUST BE TRUE



More information about the adegenet-commits mailing list