[adegenet-commits] r521 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 7 17:29:49 CET 2010


Author: jombart
Date: 2010-01-07 17:29:49 +0100 (Thu, 07 Jan 2010)
New Revision: 521

Modified:
   pkg/R/seqTrack.R
Log:
One bug corrected constructing the data.frame is result is of type seqTrack.
Weights are lost during matrix-> graphNEL conversion (what a shitty function!)


Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R	2010-01-07 16:21:34 UTC (rev 520)
+++ pkg/R/seqTrack.R	2010-01-07 16:29:49 UTC (rev 521)
@@ -391,11 +391,11 @@
     ## SHAPE OUTPUT ##
     if(res.type=="seqTrack"){
         myLev <- x.names
-        res <- data.frame()
+        N <- length(x.names)
+        res <- data.frame(id=1:N)
         class(res) <- c("seqTrack","data.frame")
 
         ## fill in the data.frame
-        res$id <- as.integer(factor(temp$edgeList["to",], levels=myLev))
         res$ances <- as.integer(factor(temp$edgeList["from",], levels=myLev))
         newOrd <- order(res$id)
         res$id <- res$id[newOrd]



More information about the adegenet-commits mailing list