[adegenet-commits] r815 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Feb 21 15:37:59 CET 2011
Author: jombart
Date: 2011-02-21 15:37:58 +0100 (Mon, 21 Feb 2011)
New Revision: 815
Modified:
pkg/R/glFunctions.R
Log:
glPca is now OK. Need to do some speed test now, possibly check for possible optimization.
Modified: pkg/R/glFunctions.R
===================================================================
--- pkg/R/glFunctions.R 2011-02-21 14:29:10 UTC (rev 814)
+++ pkg/R/glFunctions.R 2011-02-21 14:37:58 UTC (rev 815)
@@ -534,26 +534,26 @@
#### TESTING PCA ####
-M <- matrix(sample(c(0,1), 20*1e3, replace=TRUE), nrow=20)
-rownames(M) <- paste("ind", 1:20)
+## M <- matrix(sample(c(0,1), 20*1e3, replace=TRUE), nrow=20)
+## rownames(M) <- paste("ind", 1:20)
- x <- new("genlight",M)
-res1 <- glPca(x, nf=4)
-res2 <- glPca(x, useC=FALSE, nf=4)
-res3 <- dudi.pca(M, center=TRUE,scale=FALSE, scannf=FALSE,nf=4)
+## x <- new("genlight",M)
+## res1 <- glPca(x, nf=4)
+## res2 <- glPca(x, useC=FALSE, nf=4)
+## res3 <- dudi.pca(M, center=TRUE,scale=FALSE, scannf=FALSE,nf=4)
-## all must be TRUE
-all.equal(res1$eig,res3$eig)
-all.equal(res2$eig,res3$eig)
-all.equal(res1$eig,res2$eig)
+## ## all must be TRUE
+## all.equal(res1$eig,res3$eig)
+## all.equal(res2$eig,res3$eig)
+## all.equal(res1$eig,res2$eig)
-all(abs(res1$scores-res3$li)<1e-8)
-all(abs(res2$scores-res3$li)<1e-8)
-all(abs(res1$scores-res2$scores)<1e-8)
+## all(abs(res1$scores)-abs(res3$li)<1e-8)
+## all(abs(res2$scores)-abs(res3$li)<1e-8)
+## all(abs(res1$scores)-abs(res2$scores)<1e-8)
-all(abs(res1$loadings-res3$c1)<1e-8)
-all(abs(res2$loadings-res3$c1)<1e-8)
-all(abs(res1$loadings-res2$loadings)<1e-8)
+## all(abs(res1$loadings)-abs(res3$c1)<1e-8)
+## all(abs(res2$loadings)-abs(res3$c1)<1e-8)
+## all(abs(res1$loadings)-abs(res2$loadings)<1e-8)
## ## perform ordinary PCA
More information about the adegenet-commits
mailing list