[Highfrequency-commits] r134 - pkg/highfrequency/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jun 5 14:03:29 CEST 2015
Author: payseur
Date: 2015-06-05 14:03:28 +0200 (Fri, 05 Jun 2015)
New Revision: 134
Modified:
pkg/highfrequency/R/realized.R
Log:
Back to plot.xts
Modified: pkg/highfrequency/R/realized.R
===================================================================
--- pkg/highfrequency/R/realized.R 2015-06-02 22:39:37 UTC (rev 133)
+++ pkg/highfrequency/R/realized.R 2015-06-05 12:03:28 UTC (rev 134)
@@ -2024,12 +2024,19 @@
# There is an error in plot.xts that prevents colors from being passed.
# axis(1,time(b)[ind], format(time(b)[ind],), las=2, cex.axis=0.8); not used anymore
# axis(2);
- observed <- as.zoo(observed)
- fitted <- as.zoo(fitted)
- plot.zoo(observed,main=title, ylim=g_range,xlab="Time",ylab="Realized Volatility", col='red',lwd=2);
+
+ plot.xts(observed,main=title, ylim=g_range,xlab="Time",ylab="Realized Volatility");
+
+ if(packageVersion('xts')<='0.9.7'){
+ lines(observed,col="red",lwd=2);
lines(fitted,col="blue",lwd=2);
- legend("topleft", c("Observed RV","Forecasted RV"), col=c("red","blue"),lty=1, lwd=2, bty="n");
+ }else{
+ lines(observed,col="red",lwd=2, on=1);
+ lines(fitted,col="blue",lwd=2, on=1);
+ }
+ legend("topleft", c("Observed RV","Forecasted RV"), col=c("red","blue"),lty=1, lwd=2, bty="n");
+
}
##################################################################################################
More information about the Highfrequency-commits
mailing list