[Phylobase-commits] r797 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 15 10:37:24 CEST 2010


Author: francois
Date: 2010-07-15 10:37:24 +0200 (Thu, 15 Jul 2010)
New Revision: 797

Modified:
   pkg/R/treePlot.R
Log:
work around bug that produces small, uncentered circles for tips with null data on PDF

Modified: pkg/R/treePlot.R
===================================================================
--- pkg/R/treePlot.R	2010-07-15 08:34:28 UTC (rev 796)
+++ pkg/R/treePlot.R	2010-07-15 08:37:24 UTC (rev 797)
@@ -377,7 +377,7 @@
 
     maxr <- ifelse(ncol(tipdata) > nTips(phy), 1 / ncol(tipdata), 1 / nTips(phy))
     tipdataS <- apply(tipdata, 2,
-                    function(x) (maxr * x) / max(abs(x), na.rm = TRUE))
+                      function(x) (maxr * x) / max(abs(x), na.rm = TRUE))
     if(nVars == 1) {
         xpos <- 0.5
     } else {
@@ -399,7 +399,7 @@
     naxs <- naxs[dnas]
     nays <- nays[dnas]
     ## set the NA points to zero so that grid.circle doesn't crash
-    tipdataS[is.na(tipdataS)] <- 0
+    tipdataS[is.na(tipdataS)] <- 0 + 0.001  # workaround negative circles on PDF
 
     ## get label widths
     if(lab.right) {



More information about the Phylobase-commits mailing list