[adegenet-commits] r583 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 19 13:05:20 CET 2010


Author: jombart
Date: 2010-02-19 13:05:20 +0100 (Fri, 19 Feb 2010)
New Revision: 583

Modified:
   pkg/R/haploPop.R
Log:
Colors for tips part of arguments in plot haploPop


Modified: pkg/R/haploPop.R
===================================================================
--- pkg/R/haploPop.R	2010-02-18 20:15:30 UTC (rev 582)
+++ pkg/R/haploPop.R	2010-02-19 12:05:20 UTC (rev 583)
@@ -474,7 +474,7 @@
 ###############
 ## plot.haploPop
 ###############
-plot.haploPop <- function(x, y=NULL, type="unrooted", size.limit=300, show.pop=TRUE,
+plot.haploPop <- function(x, y=NULL, type="unrooted", size.limit=300, show.pop=TRUE, col=NULL,
                           transp=TRUE, tip.cex=2, method=c("nj", "bionj", "fastme.bal", "fastme.ols"), ...){
     ## CHECKS ##
     if(!require(ape)) stop("ape package is required")
@@ -500,7 +500,9 @@
 
 
     ## SHOW POPULATIONS ##
-    if(show.pop){
+    if(!is.null(col)){
+         points(xy$xx[2:(N+1)], xy$yy[2:(N+1)], pch=20, col=col, cex=tip.cex)
+    } else if(show.pop){
         nPop <- length(x$pop)
         popSizes <- sapply(x$pop, length)
         pop.id <- rep(1:length(x$pop), popSizes)



More information about the adegenet-commits mailing list