[adegenet-commits] r706 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 5 15:21:28 CET 2010


Author: jombart
Date: 2010-11-05 15:21:28 +0100 (Fri, 05 Nov 2010)
New Revision: 706

Modified:
   pkg/R/makefreq.R
Log:
Fix for bug reported by Alessio Boattini


Modified: pkg/R/makefreq.R
===================================================================
--- pkg/R/makefreq.R	2010-11-04 17:23:07 UTC (rev 705)
+++ pkg/R/makefreq.R	2010-11-05 14:21:28 UTC (rev 706)
@@ -25,7 +25,7 @@
 
   # tabfreq is a pop x loci table of allelic frequencies
   tabfreq <- t(apply(tabcount,1,function(r) unlist(tapply(r,x at loc.fac,f1))))
-  if(x at loc.nall == 1) tabfreq <- t(tabfreq) # matrix is transposed by apply if there's a single allele
+  if(length(x at loc.nall)==1 && x at loc.nall[1]==1) tabfreq <- t(tabfreq) # matrix is transposed by apply if there's a single allele
   colnames(tabfreq) <- colnames(x at tab)
 
   # NA treatment



More information about the adegenet-commits mailing list