[Blotter-commits] r1624 - pkg/quantstrat/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jul 12 20:23:21 CEST 2014


Author: efmrforge
Date: 2014-07-12 20:23:21 +0200 (Sat, 12 Jul 2014)
New Revision: 1624

Modified:
   pkg/quantstrat/R/tradeGraphs.R
Log:
Fix of 5788 thanks to Jonathan Owen 


Modified: pkg/quantstrat/R/tradeGraphs.R
===================================================================
--- pkg/quantstrat/R/tradeGraphs.R	2014-07-11 15:50:02 UTC (rev 1623)
+++ pkg/quantstrat/R/tradeGraphs.R	2014-07-12 18:23:21 UTC (rev 1624)
@@ -49,10 +49,16 @@
         } else {
             data <- subset(stats, eval(parse(text=params.filter)), select =  c(var1, var2, var3))
         }
-        x <- recast(data, as.formula(paste0(var1, " ~ ", var2)) , id.var=c(var1,var2), measure.var=c(var3))$labels[[1]][,1]
-        y <-  recast(data, as.formula(paste0(var1, " ~ ", var2)) , id.var=c(var1,var2), measure.var=c(var3))$labels[[2]][,1]
-        z <-  recast(data, as.formula(paste0(var1, " ~ ", var2)) , id.var=c(var1,var2), measure.var=c(var3))$data
 
+        data_r = recast(data, as.formula(paste0(var1, " ~ ", var2)), id.var=c(var1,var2), measure.var=c(var3))
+        x <- data_r[, 1]
+         y <- as.numeric(colnames(data_r)[-1])
+z <- unlist(data_r[, -1])
+
+        # x <- recast(data, as.formula(paste0(var1, " ~ ", var2)) , id.var=c(var1,var2), measure.var=c(var3))$labels[[1]][,1]
+        # y <-  recast(data, as.formula(paste0(var1, " ~ ", var2)) , id.var=c(var1,var2), measure.var=c(var3))$labels[[2]][,1]
+        # z <-  recast(data, as.formula(paste0(var1, " ~ ", var2)) , id.var=c(var1,var2), measure.var=c(var3))$data
+
         col <- heat.colors(length(z))[rank(z)]
 
         open3d()



More information about the Blotter-commits mailing list