[adegenet-commits] r787 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 26 18:18:58 CET 2011


Author: jombart
Date: 2011-01-26 18:18:58 +0100 (Wed, 26 Jan 2011)
New Revision: 787

Modified:
   pkg/R/glFunctions.R
Log:
Fixed a minor bug in glPca


Modified: pkg/R/glFunctions.R
===================================================================
--- pkg/R/glFunctions.R	2011-01-26 16:52:46 UTC (rev 786)
+++ pkg/R/glFunctions.R	2011-01-26 17:18:58 UTC (rev 787)
@@ -281,7 +281,9 @@
     ## need to decompose X^TDV into a sum of n matrices of dim p*r
     ## but only two such matrices are represented at a time
     if(loadings){
-        vecSd <- sqrt(vecVar)
+        if(scale) {
+            vecSd <- sqrt(vecVar)
+        }
         res$loadings <- matrix(0, nrow=nLoc(x), ncol=nf) # create empty matrix
         ## use: c1 = X^TDV
         ## and X^TV = A_1 + ... + A_n



More information about the adegenet-commits mailing list