[Returnanalytics-commits] r3468 - in pkg/PerformanceAnalytics/sandbox/PAenhance: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jul 9 08:46:28 CEST 2014


Author: kecoli
Date: 2014-07-09 08:46:28 +0200 (Wed, 09 Jul 2014)
New Revision: 3468

Modified:
   pkg/PerformanceAnalytics/sandbox/PAenhance/NAMESPACE
   pkg/PerformanceAnalytics/sandbox/PAenhance/R/table.Performance.R
   pkg/PerformanceAnalytics/sandbox/PAenhance/man/SharpeRatio.Rd
   pkg/PerformanceAnalytics/sandbox/PAenhance/man/UncertaintyMeasure.Rd
   pkg/PerformanceAnalytics/sandbox/PAenhance/man/chart.Boxplot.Rd
   pkg/PerformanceAnalytics/sandbox/PAenhance/man/chart.QQPlot.Rd
   pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.Rd
   pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.pool.Rd
   pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.pool.cran.Rd
Log:
add optional argument exportXLS to table.Performance(), that one can export the Performance table to an Excel file. 

Modified: pkg/PerformanceAnalytics/sandbox/PAenhance/NAMESPACE
===================================================================
--- pkg/PerformanceAnalytics/sandbox/PAenhance/NAMESPACE	2014-07-08 02:57:54 UTC (rev 3467)
+++ pkg/PerformanceAnalytics/sandbox/PAenhance/NAMESPACE	2014-07-09 06:46:28 UTC (rev 3468)
@@ -1,4 +1,4 @@
-# Generated by roxygen2 (4.0.1.99): do not edit by hand
+# Generated by roxygen2 (4.0.0): do not edit by hand
 
 export(SharpeRatio)
 export(chart.Boxplot)

Modified: pkg/PerformanceAnalytics/sandbox/PAenhance/R/table.Performance.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/PAenhance/R/table.Performance.R	2014-07-08 02:57:54 UTC (rev 3467)
+++ pkg/PerformanceAnalytics/sandbox/PAenhance/R/table.Performance.R	2014-07-09 06:46:28 UTC (rev 3468)
@@ -19,8 +19,10 @@
 #' @param arg.list optional argument to specify input optional argument for each metric, uses 
 #' only interactive=FALSE
 #' @param digits optional argument to specify the significant digits in printed table, default is 4
-#' @param latex logical, default is FALSE, optional arguemnt to output latex code
-#' @param exportFun logical, default is FALSE, optional argument to export function, see details
+#' @param latex logical, default is FALSE, optional argument to output latex code
+#' @param exportFun logical, default is NULL, optional argument to export function, see details
+#' @param exportXLS logical, default is FALSE, optional argument to export resulting table to excel file
+#' @param ExcelFileName The name of the Excel file to be created, default is "PerformanceReport.XLSX"
 #' @details use \code{table.Performance.pool} to check available metrics. recoded SharpeRatio.
 #' Both interactive and fixed input on metric set and optional arguments. Output latex code for resulting table. Export function that uses the same metrics and optional argument from interactive input. 
 #' @author Kirk Li  \email{kirkli@@stat.washington.edu} 
@@ -63,9 +65,15 @@
 #' myfun1(R=edhec)  
 #' # myfun1 uses res.ex5's metrics and optional arguments 
 #' args(myfun1)
+#' 
+#' # Example 6: Export XLSX 
+#' res.ex6 <- table.Performance(R=edhec,metrics=c("VaR", "ES"), interactive=FALSE, 
+#' arg.list=arg.list, verbose=T, digits=4, latex=TRUE, exportXLS=TRUE,ExcelFileName="PerformanceReport.xls")
+#' 
+#' 
 #' @export
 table.Performance <-
-		function(R,metrics=NULL,metricsNames=NULL, verbose=FALSE, interactive=TRUE, arg.list=NULL, digits=4, latex=FALSE, exportFun=NULL, flag.pre.arg.list=FALSE,...){
+		function(R,metrics=NULL,metricsNames=NULL, verbose=FALSE, interactive=TRUE, arg.list=NULL, digits=4, latex=FALSE, exportFun=NULL, exportXLS=FALSE, ExcelFileName="PerformanceReport.xls",flag.pre.arg.list=FALSE,...){
 	# FUNCTION: 47-1 different metrics
 	pool <- table.Performance.pool()
 	
@@ -295,6 +303,16 @@
 		
 	}
 	
+  if(exportXLS){
+      cat("###################################","\n")
+      cat(paste0("Exporting to Excel file ",ExcelFileName,"\n"))
+      cat("###################################","\n")
+    require(WriteXLS)
+    temp <- res$resultingtable
+    inslib(WriteXLS)
+    WriteXLS("temp",row.names = TRUE,ExcelFileName=ExcelFileName )
+    
+  }
 	return(res)
 }
 

Modified: pkg/PerformanceAnalytics/sandbox/PAenhance/man/SharpeRatio.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/PAenhance/man/SharpeRatio.Rd	2014-07-08 02:57:54 UTC (rev 3467)
+++ pkg/PerformanceAnalytics/sandbox/PAenhance/man/SharpeRatio.Rd	2014-07-09 06:46:28 UTC (rev 3468)
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.0.1.99): do not edit by hand
+% Generated by roxygen2 (4.0.0): do not edit by hand
 \name{SharpeRatio}
 \alias{SharpeRatio}
 \alias{SharpeRatio.modified}

Modified: pkg/PerformanceAnalytics/sandbox/PAenhance/man/UncertaintyMeasure.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/PAenhance/man/UncertaintyMeasure.Rd	2014-07-08 02:57:54 UTC (rev 3467)
+++ pkg/PerformanceAnalytics/sandbox/PAenhance/man/UncertaintyMeasure.Rd	2014-07-09 06:46:28 UTC (rev 3468)
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.0.1.99): do not edit by hand
+% Generated by roxygen2 (4.0.0): do not edit by hand
 \name{var.se}
 \alias{var.se}
 \title{Uncertainty measure of Variance Estimator

Modified: pkg/PerformanceAnalytics/sandbox/PAenhance/man/chart.Boxplot.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/PAenhance/man/chart.Boxplot.Rd	2014-07-08 02:57:54 UTC (rev 3467)
+++ pkg/PerformanceAnalytics/sandbox/PAenhance/man/chart.Boxplot.Rd	2014-07-09 06:46:28 UTC (rev 3468)
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.0.1.99): do not edit by hand
+% Generated by roxygen2 (4.0.0): do not edit by hand
 \name{chart.Boxplot}
 \alias{chart.Boxplot}
 \title{box whiskers plot wrapper}

Modified: pkg/PerformanceAnalytics/sandbox/PAenhance/man/chart.QQPlot.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/PAenhance/man/chart.QQPlot.Rd	2014-07-08 02:57:54 UTC (rev 3467)
+++ pkg/PerformanceAnalytics/sandbox/PAenhance/man/chart.QQPlot.Rd	2014-07-09 06:46:28 UTC (rev 3468)
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.0.1.99): do not edit by hand
+% Generated by roxygen2 (4.0.0): do not edit by hand
 \name{chart.QQPlot}
 \alias{chart.QQPlot}
 \title{Plot a QQ chart}

Modified: pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.Rd	2014-07-08 02:57:54 UTC (rev 3467)
+++ pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.Rd	2014-07-09 06:46:28 UTC (rev 3468)
@@ -1,11 +1,12 @@
-% Generated by roxygen2 (4.0.1.99): do not edit by hand
+% Generated by roxygen2 (4.0.0): do not edit by hand
 \name{table.Performance}
 \alias{table.Performance}
 \title{Generate general performance table for returns}
 \usage{
 table.Performance(R, metrics = NULL, metricsNames = NULL, verbose = FALSE,
   interactive = TRUE, arg.list = NULL, digits = 4, latex = FALSE,
-  exportFun = NULL, flag.pre.arg.list = FALSE, ...)
+  exportFun = NULL, exportXLS = FALSE,
+  ExcelFileName = "PerformanceReport.XLSX", flag.pre.arg.list = FALSE, ...)
 }
 \arguments{
   \item{R}{an xts, vector, matrix, data frame, timeSeries
@@ -28,11 +29,17 @@
   \item{digits}{optional argument to specify the
   significant digits in printed table, default is 4}
 
-  \item{latex}{logical, default is FALSE, optional arguemnt
+  \item{latex}{logical, default is FALSE, optional argument
   to output latex code}
 
-  \item{exportFun}{logical, default is FALSE, optional
+  \item{exportFun}{logical, default is NULL, optional
   argument to export function, see details}
+
+  \item{exportXLS}{logical, default is FALSE, optional
+  argument to export resulting table to excel file}
+
+  \item{ExcelFileName}{The name of the Excel file to be
+  created, default is "PerformanceReport.XLSX"}
 }
 \description{
 Main function to produce summary table. user can choose a

Modified: pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.pool.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.pool.Rd	2014-07-08 02:57:54 UTC (rev 3467)
+++ pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.pool.Rd	2014-07-09 06:46:28 UTC (rev 3468)
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.0.1.99): do not edit by hand
+% Generated by roxygen2 (4.0.0): do not edit by hand
 \name{table.Performance.pool}
 \alias{table.Performance.pool}
 \title{Print metrics from R-forge PerformanceAnalytics that compatible with table.Performance}

Modified: pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.pool.cran.Rd
===================================================================
--- pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.pool.cran.Rd	2014-07-08 02:57:54 UTC (rev 3467)
+++ pkg/PerformanceAnalytics/sandbox/PAenhance/man/table.Performance.pool.cran.Rd	2014-07-09 06:46:28 UTC (rev 3468)
@@ -1,4 +1,4 @@
-% Generated by roxygen2 (4.0.1.99): do not edit by hand
+% Generated by roxygen2 (4.0.0): do not edit by hand
 \name{table.Performance.pool.cran}
 \alias{table.Performance.pool.cran}
 \title{Print metrics from R CRAN PerformanceAnalytics that compatible with table.Performance}



More information about the Returnanalytics-commits mailing list