[adegenet-commits] r585 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Feb 22 15:45:43 CET 2010


Author: jombart
Date: 2010-02-22 15:45:43 +0100 (Mon, 22 Feb 2010)
New Revision: 585

Modified:
   pkg/R/haploPop.R
Log:
forgot to commit it ?!


Modified: pkg/R/haploPop.R
===================================================================
--- pkg/R/haploPop.R	2010-02-19 12:12:55 UTC (rev 584)
+++ pkg/R/haploPop.R	2010-02-22 14:45:43 UTC (rev 585)
@@ -501,13 +501,16 @@
 
     ## SHOW POPULATIONS ##
     if(!is.null(col)){
-          if(transp){
+        if(is.integer(col) | is.numeric(col)) {
+            col <- palette()[col]
+        }
+        if(transp){
             transp <- function(col, alpha=.5){
                 res <- apply(col2rgb(col),2, function(c) rgb(c[1]/255, c[2]/255, c[3]/255, alpha))
                 return(res)
             }
 
-            pop <- transp(pop)
+            col <- transp(col)
         }
           points(xy$xx[2:(N+1)], xy$yy[2:(N+1)], pch=20, col=col, cex=tip.cex)
 



More information about the adegenet-commits mailing list