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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 13 15:07:40 CEST 2008


Author: jombart
Date: 2008-10-13 15:07:40 +0200 (Mon, 13 Oct 2008)
New Revision: 192

Modified:
   pkg/R/spca.R
   pkg/man/spca.Rd
Log:
Fixed plot.spca so that useLag is used.


Modified: pkg/R/spca.R
===================================================================
--- pkg/R/spca.R	2008-10-13 10:23:22 UTC (rev 191)
+++ pkg/R/spca.R	2008-10-13 13:07:40 UTC (rev 192)
@@ -282,7 +282,7 @@
 #####################
 # Function plot.spca
 #####################
-plot.spca <- function (x, axis = 1, ...){
+plot.spca <- function (x, axis = 1, useLag=FALSE, ...){
     if (!inherits(x, "spca")) stop("Use only with 'spca' objects.")
 
     if(!require(ade4)) stop("ade4 package is required.")
@@ -295,7 +295,13 @@
 
     n <- nrow(x$li)
     xy <- x$xy
-    z <- x$ls[,axis]
+
+    ## handle useLag argument
+    if(useLag){
+        z <- x$ls[,axis]
+    } else {
+        z <- x$li[,axis]
+    } # end if useLag
     nfposi <- x$nfposi
     nfnega <- x$nfnega
     ## handle neig parameter - hide cn if nore than 100 links

Modified: pkg/man/spca.Rd
===================================================================
--- pkg/man/spca.Rd	2008-10-13 10:23:22 UTC (rev 191)
+++ pkg/man/spca.Rd	2008-10-13 13:07:40 UTC (rev 192)
@@ -38,7 +38,7 @@
 
 \method{summary}{spca}(object, \dots, printres=TRUE)
 
-\method{plot}{spca}(x, axis = 1, \dots)
+\method{plot}{spca}(x, axis = 1, useLag=FALSE, \dots)
 
 \method{screeplot}{spca}(x, \dots, main=NULL)
 



More information about the adegenet-commits mailing list