[Xts-commits] r662 - pkg/xtsExtra/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jul 2 22:03:58 CEST 2012


Author: weylandt
Date: 2012-07-02 22:03:58 +0200 (Mon, 02 Jul 2012)
New Revision: 662

Modified:
   pkg/xtsExtra/R/barplot.R
Log:
Fixed odd double plotting bug in barplot x-axis ticks

Modified: pkg/xtsExtra/R/barplot.R
===================================================================
--- pkg/xtsExtra/R/barplot.R	2012-07-02 19:31:49 UTC (rev 661)
+++ pkg/xtsExtra/R/barplot.R	2012-07-02 20:03:58 UTC (rev 662)
@@ -47,7 +47,7 @@
   
   if(nr == 1L){
     warning("Time-oriented barplot for single observation not well defined.\n  Dispatching instead to unstacked default barplot.")
-    # SHould I instead let this be forced?
+    # Should I instead let this be forced?
     return(barplot(coredata(x), ylim=NULL, space = 0.2, 
                    ylab="Value",las = 2, xaxis.labels = xaxis.labels, col = col, ...))
   }
@@ -62,7 +62,10 @@
   # Vectorize this?
   for(i in 1:length(ep)) 
     ep1[i] = posn[ep[i]]
-    
+  
+  # Handle strange double-plotting from axTicksByTime
+  ep1 <- ep1[!duplicated(ep1)]
+  
   if(is.null(col)) col <- seq_len(nc)
     
   minmargin <- if(is.null(xlab)) 3 else 5



More information about the Xts-commits mailing list