[adegenet-commits] r537 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 19 01:47:40 CET 2010


Author: jombart
Date: 2010-01-19 01:47:39 +0100 (Tue, 19 Jan 2010)
New Revision: 537

Modified:
   pkg/R/colorplot.R
Log:
bug corrected in colorplot when axes retained where not specified.


Modified: pkg/R/colorplot.R
===================================================================
--- pkg/R/colorplot.R	2010-01-18 12:16:23 UTC (rev 536)
+++ pkg/R/colorplot.R	2010-01-19 00:47:39 UTC (rev 537)
@@ -19,13 +19,16 @@
 #################
 # default method
 #################
-colorplot.default <- function(xy, X, axes=1:ncol(X), add.plot=FALSE, defaultLevel=0, transp=FALSE, alpha=.5, ...){
+colorplot.default <- function(xy, X, axes=NULL, add.plot=FALSE, defaultLevel=0, transp=FALSE, alpha=.5, ...){
 
     ## some checks
     if(any(is.na(xy))) stop("NAs exist in xy")
     xy <- as.matrix(xy)
     if(!is.numeric(xy)) stop("xy is not numeric")
     if(nrow(xy) != nrow(X)) stop("xy and X have different row numbers")
+    if(is.null(axes)) {
+        axes <- 1:min(ncol(X),3)
+    }
     X <- as.matrix(X[,axes,drop=FALSE])
     if(any(is.na(X))) stop("NAs exist in X")
     if(!is.numeric(X)) stop("X is not numeric")



More information about the adegenet-commits mailing list