[Xts-commits] r874 - in pkg/xts: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 29 18:54:32 CET 2015


Author: rossbennett34
Date: 2015-01-29 18:54:32 +0100 (Thu, 29 Jan 2015)
New Revision: 874

Modified:
   pkg/xts/DESCRIPTION
   pkg/xts/R/plot.R
Log:
fix bug in addEventLines that clobbered user argument for col

Modified: pkg/xts/DESCRIPTION
===================================================================
--- pkg/xts/DESCRIPTION	2015-01-25 13:29:48 UTC (rev 873)
+++ pkg/xts/DESCRIPTION	2015-01-29 17:54:32 UTC (rev 874)
@@ -1,7 +1,7 @@
 Package: xts
 Type: Package
 Title: eXtensible Time Series
-Version: 0.9.873
+Version: 0.9.874
 Date: $Date$
 Author: Jeffrey A. Ryan, Joshua M. Ulrich
 Depends: zoo (>= 1.7-10)

Modified: pkg/xts/R/plot.R
===================================================================
--- pkg/xts/R/plot.R	2015-01-25 13:29:48 UTC (rev 873)
+++ pkg/xts/R/plot.R	2015-01-29 17:54:32 UTC (rev 874)
@@ -917,12 +917,18 @@
   if(!is.null(event.labels))
     if(length(event.dates) != length(event.labels)) stop("length of event.dates must match length of event.labels")
   
+  if(length(event.dates) > 1){
+    if(length(lty) == 1) lty <- rep(lty, length(event.dates))
+    if(length(lwd) == 1) lwd <- rep(lwd, length(event.dates))
+    if(length(col) == 1) col <- rep(col, length(event.dates))
+  }
+  
   lenv <- new.env()
   lenv$main <- main
   lenv$plot_event_lines <- function(x, event.dates, event.labels, date.format, on, lty, lwd, col, ...){
     xdata <- x$Env$xdata
     xsubset <- x$Env$xsubset
-    col <- x$Env$theme$col
+    # col <- x$Env$theme$col
     if(all(is.na(on))){
       # Add x-axis grid lines
       atbt <- axTicksByTime2(xdata[xsubset])



More information about the Xts-commits mailing list