[adegenet-commits] r852 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 29 22:25:07 CEST 2011


Author: jombart
Date: 2011-03-29 22:25:07 +0200 (Tue, 29 Mar 2011)
New Revision: 852

Modified:
   pkg/R/dapc.R
   pkg/man/dapc.Rd
Log:
argt pca.loadings -> pca.info
Added doc about pca.info.


Modified: pkg/R/dapc.R
===================================================================
--- pkg/R/dapc.R	2011-03-29 20:18:07 UTC (rev 851)
+++ pkg/R/dapc.R	2011-03-29 20:25:07 UTC (rev 852)
@@ -7,7 +7,7 @@
 ## dapc.data.frame
 ###################
 dapc.data.frame <- function(x, grp, n.pca=NULL, n.da=NULL,
-                            center=TRUE, scale=FALSE, pca.loadings=TRUE, var.contrib=TRUE,
+                            center=TRUE, scale=FALSE, var.contrib=TRUE, pca.info=TRUE,
                             pca.select=c("nbEig","percVar"), perc.pca=NULL, ..., dudi=NULL){
 
     ## FIRST CHECKS
@@ -107,7 +107,7 @@
 
 
     ## optional: store loadings of variables
-    if(pca.loadings){
+    if(pca.info){
         res$pca.loadings <- as.matrix(U)
         res$pca.cent <- pcaX$cent
         res$pca.norm <- pcaX$norm
@@ -146,7 +146,7 @@
 ## dapc.genind
 #############
 dapc.genind <- function(x, pop=NULL, n.pca=NULL, n.da=NULL,
-                        scale=FALSE, scale.method=c("sigma", "binom"), truenames=TRUE, pca.loadings=TRUE, var.contrib=TRUE,
+                        scale=FALSE, scale.method=c("sigma", "binom"), truenames=TRUE, var.contrib=TRUE, pca.info=TRUE,
                         pca.select=c("nbEig","percVar"), perc.pca=NULL, ...){
 
     ## FIRST CHECKS
@@ -203,7 +203,7 @@
 ## dapc.genlight
 #################
 dapc.genlight <- function(x, pop=NULL, n.pca=NULL, n.da=NULL,
-                          scale=FALSE,  pca.loadings=TRUE, var.contrib=TRUE,
+                          scale=FALSE,  var.contrib=TRUE, pca.info=TRUE
                           pca.select=c("nbEig","percVar"), perc.pca=NULL, glPca=NULL, ...){
     ## FIRST CHECKS ##
     if(!require(ade4, quiet=TRUE)) stop("ade4 library is required.")
@@ -328,7 +328,7 @@
 
 
     ## optional: store loadings of variables
-    if(pca.loadings){
+    if(pca.info){
         res$pca.loadings <- as.matrix(U)
         res$pca.cent <- glMean(toto,alleleAsUnit=FALSE)
         res$pca.norm <- sqrt(glVar(toto,alleleAsUnit=FALSE))

Modified: pkg/man/dapc.Rd
===================================================================
--- pkg/man/dapc.Rd	2011-03-29 20:18:07 UTC (rev 851)
+++ pkg/man/dapc.Rd	2011-03-29 20:25:07 UTC (rev 852)
@@ -42,17 +42,17 @@
 }
 \usage{
 \method{dapc}{data.frame}(x, grp, n.pca=NULL, n.da=NULL, center=TRUE,
-     scale=FALSE,var.contrib=TRUE, pca.select=c("nbEig","percVar"),
+     scale=FALSE,var.contrib=TRUE, pca.info=TRUE, pca.select=c("nbEig","percVar"),
      perc.pca=NULL, \ldots, dudi=NULL)
 
 \method{dapc}{matrix}(x, \ldots)
 
 \method{dapc}{genind}(x, pop=NULL, n.pca=NULL, n.da=NULL, scale=FALSE,
      scale.method=c("sigma", "binom"), truenames=TRUE, var.contrib=TRUE,
-     pca.select=c("nbEig","percVar"), perc.pca=NULL, \ldots)
+     pca.info=TRUE, pca.select=c("nbEig","percVar"), perc.pca=NULL, \ldots)
 
 \method{dapc}{genlight}(x, pop = NULL, n.pca = NULL, n.da = NULL, scale
-    = FALSE, var.contrib = TRUE, pca.select = c("nbEig", "percVar"),
+    = FALSE, var.contrib = TRUE, pca.info=TRUE, pca.select = c("nbEig", "percVar"),
     perc.pca = NULL, glPca = NULL, \ldots)
 
 \method{dapc}{dudi}(x, grp, \ldots)
@@ -93,6 +93,10 @@
     contribution of original variables (alleles, for \linkS4class{genind} objects)
     should be provided (TRUE, default) or not (FALSE). Such output can be useful,
     but can also create huge matrices when there is a lot of variables.}
+  \item{pca.info}{a \code{logical} indicating whether information about
+    the prior PCA should be stored (TRUE, default) or not (FALSE). This
+    information is required to predict group membership of new
+    individuals using \code{predict}, but makes the object slightly bigger.}
   \item{pca.select}{a \code{character} indicating the mode of selection of PCA
     axes, matching either "nbEig" or "percVar". For "nbEig", the user
     has to specify the number of axes retained (interactively, or via



More information about the adegenet-commits mailing list