[adegenet-commits] r683 - pkg/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Oct 7 17:53:13 CEST 2010
Author: jombart
Date: 2010-10-07 17:53:12 +0200 (Thu, 07 Oct 2010)
New Revision: 683
Modified:
pkg/R/dapc.R
Log:
Passing a very low tolerance to lda.default to avoid rescaling issues when conserving all the PCs.
Modified: pkg/R/dapc.R
===================================================================
--- pkg/R/dapc.R 2010-10-06 15:07:05 UTC (rev 682)
+++ pkg/R/dapc.R 2010-10-07 15:53:12 UTC (rev 683)
@@ -50,6 +50,7 @@
## get n.pca from the % of variance to conserve
if(!is.null(perc.pca)){
n.pca <- min(which(cumVar >= perc.pca))
+ if(perc.pca > 99.999) n.pca <- length(pcaX$eig)
if(n.pca<1) n.pca <- 1
}
@@ -68,7 +69,7 @@
## PERFORM DA ##
- ldaX <- lda(XU, grp)
+ ldaX <- lda(XU, grp, tol=1e-30) # tol=1e-30 is a kludge, but a safe (?) one to avoid fancy rescaling by lda.default
if(is.null(n.da)){
barplot(ldaX$svd^2, xlab="Linear Discriminants", ylab="F-statistic", main="Discriminant analysis eigenvalues", col=heat.colors(length(levels(grp))) )
cat("Choose the number discriminant functions to retain (>=1): ")
@@ -328,6 +329,19 @@
+
+
+############
+## crossval
+############
+crossval <- function (x, ...) UseMethod("crossval")
+
+crossval.dapc <- function(){
+
+}
+
+
+
###############
## randtest.dapc
###############
More information about the adegenet-commits
mailing list