[adegenet-commits] r513 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 7 18:50:18 CET 2009


Author: jombart
Date: 2009-12-07 18:50:18 +0100 (Mon, 07 Dec 2009)
New Revision: 513

Modified:
   pkg/R/dapc.R
Log:
There were syntax error (?!?) remaining.


Modified: pkg/R/dapc.R
===================================================================
--- pkg/R/dapc.R	2009-12-04 18:03:22 UTC (rev 512)
+++ pkg/R/dapc.R	2009-12-07 17:50:18 UTC (rev 513)
@@ -6,7 +6,7 @@
 ######################
 ## find.clusters.data.frame
 ######################
-find.clusters.data.frame <- function(x, n.pca=NULL, n.clust=NULL, stat=c("BIC", "AIC", "WSS"), choose.n.clust=TRUE, criterion=c("min","diff")
+find.clusters.data.frame <- function(x, n.pca=NULL, n.clust=NULL, stat=c("BIC", "AIC", "WSS"), choose.n.clust=TRUE, criterion=c("min","diff"),
                                      max.n.clust=round(nrow(x)/10), n.iter=1e6, n.start=100, center=TRUE, scale=TRUE){
 
     ## CHECKS ##
@@ -96,7 +96,7 @@
             }
             if(criterion=="diff") {
                 temp <- diff(myStat)
-                n.clust <- which.max( which((temp-min(temp))< max(temp)/1e4)) )
+                n.clust <- which.max( which( (temp-min(temp))<max(temp)/1e4))
             }
         }
     }



More information about the adegenet-commits mailing list