[Returnanalytics-commits] r3190 - pkg/PerformanceAnalytics/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Sep 26 17:40:34 CEST 2013


Author: peter_carl
Date: 2013-09-26 17:40:34 +0200 (Thu, 26 Sep 2013)
New Revision: 3190

Modified:
   pkg/PerformanceAnalytics/R/chart.VaRSensitivity.R
Log:
- added ylim so that axis can be adjusted


Modified: pkg/PerformanceAnalytics/R/chart.VaRSensitivity.R
===================================================================
--- pkg/PerformanceAnalytics/R/chart.VaRSensitivity.R	2013-09-26 15:21:47 UTC (rev 3189)
+++ pkg/PerformanceAnalytics/R/chart.VaRSensitivity.R	2013-09-26 15:40:34 UTC (rev 3190)
@@ -47,7 +47,7 @@
 #' 
 #' @export 
 chart.VaRSensitivity <-
-function (R, methods = c("GaussianVaR", "ModifiedVaR", "HistoricalVaR","GaussianES", "ModifiedES", "HistoricalES"), clean=c("none", "boudt", "geltner"), elementcolor="darkgray", reference.grid=TRUE, xlab = "Confidence Level", ylab="Value at Risk", type = "l", lty = c(1,2,4), lwd = 1, colorset = (1:12), pch = (1:12), legend.loc = "bottomleft", cex.legend = 0.8, main=NULL,...)
+function (R, methods = c("GaussianVaR", "ModifiedVaR", "HistoricalVaR","GaussianES", "ModifiedES", "HistoricalES"), clean=c("none", "boudt", "geltner"), elementcolor="darkgray", reference.grid=TRUE, xlab = "Confidence Level", ylab="Value at Risk", type = "l", lty = c(1,2,4), lwd = 1, colorset = (1:12), pch = (1:12), legend.loc = "bottomleft", cex.legend = 0.8, main=NULL, ylim=NULL, ...)
 { # @author Peter Carl
 
     R = checkData(R)
@@ -106,7 +106,8 @@
 # print(risk)
 
     risk.columns = ncol(risk)
-    ylim=c(min(risk),max(risk))
+    if(is.null(ylim))
+        ylim=c(min(risk),max(risk))
     xlim=c(min(p), max(p))
     if(is.null(main))
         main=paste("Risk Confidence Sensitivity of ", columnnames[1], sep="")



More information about the Returnanalytics-commits mailing list