[adegenet-commits] r1126 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 14 17:20:13 CEST 2013


Author: jombart
Date: 2013-05-14 17:20:13 +0200 (Tue, 14 May 2013)
New Revision: 1126

Modified:
   pkg/R/auxil.R
Log:
fixed handling of missing data

Modified: pkg/R/auxil.R
===================================================================
--- pkg/R/auxil.R	2013-05-14 14:30:28 UTC (rev 1125)
+++ pkg/R/auxil.R	2013-05-14 15:20:13 UTC (rev 1126)
@@ -257,14 +257,14 @@
 any2col <- function(x, col.pal=seasun, na.col="transparent"){
     ## handle numeric data
     if(is.numeric(x)){
-        col <- num2col(x, col.pal=col.pal)
+        col <- num2col(x, col.pal=col.pal, na.col=na.col)
         leg.col <- num2col(pretty(x), x.min=min(x, na.rm=TRUE),
                            x.max=max(x, na.rm=TRUE), col.pal=col.pal,
                            na.col=na.col)
         leg.txt <- pretty(x)
     } else{ ## handle factor
         x <- factor(x)
-        col <- fac2col(x, col.pal=col.pal)
+        col <- fac2col(x, col.pal=col.pal, na.col=na.col)
         leg.col <- col.pal(length(levels(x)))
         leg.txt <- levels(x)
     }



More information about the adegenet-commits mailing list