From b52a709804bfc861b53dd52c2fa22476f99448d0 Mon Sep 17 00:00:00 2001 From: Kyle Balkissoon Date: Thu, 2 Oct 2014 15:44:55 -0400 Subject: [PATCH] Create factsheetgenerator.R Makes a factsheet --- factsheetgenerator.R | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 factsheetgenerator.R diff --git a/factsheetgenerator.R b/factsheetgenerator.R new file mode 100644 index 0000000..91cf370 --- /dev/null +++ b/factsheetgenerator.R @@ -0,0 +1,32 @@ + +#@TODO make S's into an object to be looped over and allow a graphical parameter object to be passed to it. + +make_chart_and_stuff = function(R,Rb){ + + S1 = "chart.RollingRegression(R,Rb,attribute=c('Beta'),mar=c(5, 4, 4, 2),main='Rolling Beta',pin=c(8,8),colorset=5)" + S2 = "table.Drawdowns(R-Rb,top=5)" + S3 = "chart.BarVaR(R,pin=c(8,8),main='Value at risk',colorset=3,methods='StdDev')" + S4 = "chart.RiskReturnScatter(merge.xts(R,Rb),pin=c(8,8))" + S5 = "chart.Drawdown(R-Rb,main='Relative Drawdown',pin=c(8,8),colorset=2)" + S6 = "chart.RelativePerformance(R,Rb,pin=c(8,8))" + S7 = "chart.Boxplot(merge.xts(R,Rb),pin=c(8,8),names=FALSE)" + + + + save(R,file="R.rdata") + save(Rb,file="Rb.rdata") + save(S1,file="S1.rdata") + save(S2,file="S2.rdata") + save(S3,file="S3.rdata") + save(S4,file="S4.rdata") + save(S5,file="S5.rdata") + save(S6,file="S6.rdata") + save(S7,file="S7.rdata") + + + + + + Sweave(file="InvestmentFactsheets.Rnw") + texi2pdf("InvestmentFactsheets.tex") +}