[adegenet-commits] r330 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 28 12:12:59 CEST 2009


Author: jombart
Date: 2009-05-28 12:12:58 +0200 (Thu, 28 May 2009)
New Revision: 330

Modified:
   pkg/R/seqTrack.R
Log:
fix for plotting arrows / not plotting arrows


Modified: pkg/R/seqTrack.R
===================================================================
--- pkg/R/seqTrack.R	2009-05-27 18:55:26 UTC (rev 329)
+++ pkg/R/seqTrack.R	2009-05-28 10:12:58 UTC (rev 330)
@@ -222,13 +222,15 @@
     }
 
     ## ARROWS
-    if(useArrows){
-        arr.length <- rep(.25, length=length(x.from))
-        if(showAmbiguous & any(isAmbig)){
-            arr.length[isAmbig] <- 0
+    if(useArrows & plot){
+        if(showAmbiguous & any(isAmbig)){ # plot arrows & segments
+            suppressWarnings(arrows(x.from[!isAmbig], y.from[!isAmbig],
+                                    x.to[!isAmbig], y.to[!isAmbig], col=col[!isAmbig], angle=15, ...))
+            segments(x.from[isAmbig], y.from[isAmbig],
+                     x.to[isAmbig], y.to[isAmbig], col=col,...)
+        } else{ # plot all arrows
+            suppressWarnings(arrows(x.from, y.from, x.to, y.to, col=col, angle=15, ...))
         }
-        if(plot) suppressWarnings(arrows(x.from, y.from, x.to, y.to, col=col, angle=15, length=arr.length, ...))
-
     } else{
         ## SEGMENTS
         if(plot) segments(x.from, y.from, x.to, y.to, col=col,...)



More information about the adegenet-commits mailing list