[Returnanalytics-commits] r3381 - pkg/PortfolioAnalytics/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon May 5 21:55:24 CEST 2014
Author: rossbennett34
Date: 2014-05-05 21:55:24 +0200 (Mon, 05 May 2014)
New Revision: 3381
Modified:
pkg/PortfolioAnalytics/R/charts.efficient.frontier.R
Log:
Revising efficient frontier chart to not calculate metrics on assets unless specified in arguments
Modified: pkg/PortfolioAnalytics/R/charts.efficient.frontier.R
===================================================================
--- pkg/PortfolioAnalytics/R/charts.efficient.frontier.R 2014-05-01 06:00:59 UTC (rev 3380)
+++ pkg/PortfolioAnalytics/R/charts.efficient.frontier.R 2014-05-05 19:55:24 UTC (rev 3381)
@@ -461,10 +461,15 @@
}
if(is.na(mtc)) stop("could not match match.col with column name of efficient frontier")
- # get the data to plot scatter of asset returns
- asset_ret <- scatterFUN(R=R, FUN="mean")
- asset_risk <- scatterFUN(R=R, FUN=match.col)
- rnames <- colnames(R)
+ if(chart.assets){
+ # get the data to plot scatter of asset returns
+ asset_ret <- scatterFUN(R=R, FUN="mean")
+ asset_risk <- scatterFUN(R=R, FUN=match.col)
+ rnames <- colnames(R)
+ } else {
+ asset_ret <- NULL
+ asset_risk <- NULL
+ }
# set the x and y limits
if(is.null(xlim)){
More information about the Returnanalytics-commits
mailing list