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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 18 18:43:46 CET 2008


Author: jombart
Date: 2008-03-18 18:43:45 +0100 (Tue, 18 Mar 2008)
New Revision: 72

Modified:
   pkg/R/spca.R
   pkg/man/spca.Rd
Log:
spca: xy is seeked from $other if NULL



Modified: pkg/R/spca.R
===================================================================
--- pkg/R/spca.R	2008-03-17 14:13:29 UTC (rev 71)
+++ pkg/R/spca.R	2008-03-18 17:43:45 UTC (rev 72)
@@ -21,7 +21,8 @@
   
   if(!inherits(obj,c("genind","genpop"))) stop("obj must be a genind or genpop object.")
   invisible(validObject(obj))
-  
+
+  if(is.null(xy) & !is.null(obj$other$xy)) xy <- obj$other$xy
   if(is.data.frame(xy)) xy <- as.matrix(xy)
   if(ncol(xy) != 2) stop("xy does not have two columns.")
   if(nrow(xy) != nrow(obj at tab)) stop("obj at tab and xy must have the same row numbers.")

Modified: pkg/man/spca.Rd
===================================================================
--- pkg/man/spca.Rd	2008-03-17 14:13:29 UTC (rev 71)
+++ pkg/man/spca.Rd	2008-03-18 17:43:45 UTC (rev 72)
@@ -39,8 +39,8 @@
 }
 \arguments{
   \item{obj}{a \code{genind} or \code{genpop} object.}
-  \item{xy}{an matrix or data.frame with two columns for x and y
-    coordinates. Can be NULL if cn is provided.}
+  \item{xy}{a matrix or data.frame with two columns for x and y
+    coordinates. Seeked from obj\$other\$xy if it exists. Can be NULL if \code{cn} is provided.}
   \item{cn}{a connection network of the class 'nb' (package spdep). Can
     be NULL if xy is provided. Can be easily obtained using the function
     chooseCN.}



More information about the adegenet-commits mailing list