[Xts-commits] r827 - in pkg/xtsExtra: R sandbox

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 6 12:52:08 CEST 2014


Author: rossbennett34
Date: 2014-08-06 12:52:08 +0200 (Wed, 06 Aug 2014)
New Revision: 827

Modified:
   pkg/xtsExtra/R/plot2.R
   pkg/xtsExtra/sandbox/test_plot2.R
Log:
adding call_list slot to xts_chob environment

Modified: pkg/xtsExtra/R/plot2.R
===================================================================
--- pkg/xtsExtra/R/plot2.R	2014-08-03 05:45:09 UTC (rev 826)
+++ pkg/xtsExtra/R/plot2.R	2014-08-06 10:52:08 UTC (rev 827)
@@ -198,6 +198,8 @@
   cs$Env$ticks.on <- grid.ticks.on
   cs$Env$grid.ticks.lwd <- theme$grid.ticks.lwd
   cs$Env$type <- type
+  cs$Env$call_list <- list()
+  cs$Env$call_list[[1]] <- match.call()
   
   # Do some checks on x
   if(is.character(x))
@@ -477,6 +479,9 @@
                srcfile=NULL)
   
   plot_object <- current.xts_chob()
+  ncalls <- length(plot_object$Env$call_list)
+  plot_object$Env$call_list[[ncalls+1]] <- match.call()
+  
   xdata <- plot_object$Env$xdata
   xsubset <- plot_object$Env$xsubset
   
@@ -565,6 +570,8 @@
                                                        type=type,col=col,...)))),
                srcfile=NULL)
   plot_object <- current.xts_chob()
+  ncalls <- length(plot_object$Env$call_list)
+  plot_object$Env$call_list[[ncalls+1]] <- match.call()
   xdata <- plot_object$Env$xdata
   xsubset <- plot_object$Env$xsubset
   if(is.logical(x)) no.update <- TRUE else no.update <- FALSE
@@ -653,6 +660,8 @@
                srcfile=NULL)
   
   plot_object <- current.xts_chob()
+  ncalls <- length(plot_object$Env$call_list)
+  plot_object$Env$call_list[[ncalls+1]] <- match.call()
   
   # get the raw returns data
   xdata <- plot_object$Env$xdata
@@ -726,6 +735,9 @@
                srcfile=NULL)
   
   plot_object <- current.xts_chob()
+  ncalls <- length(plot_object$Env$call_list)
+  plot_object$Env$call_list[[ncalls+1]] <- match.call()
+  
   xdata <- plot_object$Env$xdata
   xsubset <- plot_object$Env$xsubset
   

Modified: pkg/xtsExtra/sandbox/test_plot2.R
===================================================================
--- pkg/xtsExtra/sandbox/test_plot2.R	2014-08-03 05:45:09 UTC (rev 826)
+++ pkg/xtsExtra/sandbox/test_plot2.R	2014-08-06 10:52:08 UTC (rev 827)
@@ -77,6 +77,9 @@
 addRollingPerformance(FUN="StdDev.annualized")
 addRollingPerformance(FUN="SharpeRatio.annualized")
 
+x <- xtsExtra:::current.xts_chob()
+x$Env$call_list
+x$Env$call_list[[1]]
 
 ##### scratch area #####
 # Should we have a theme object, as in quantmod, that sets all of the basic 



More information about the Xts-commits mailing list