[Returnanalytics-commits] r2996 - in pkg/PortfolioAnalytics: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Sep 5 05:29:46 CEST 2013


Author: rossbennett34
Date: 2013-09-05 05:29:45 +0200 (Thu, 05 Sep 2013)
New Revision: 2996

Added:
   pkg/PortfolioAnalytics/man/chart.Weights.EF.efficient.frontier.Rd
   pkg/PortfolioAnalytics/man/chart.Weights.EF.optimize.portfolio.Rd
Modified:
   pkg/PortfolioAnalytics/R/charts.efficient.frontier.R
   pkg/PortfolioAnalytics/man/chart.EfficientFrontier.Rd
   pkg/PortfolioAnalytics/man/chart.Weights.EF.Rd
Log:
Modifying generic method chart.Weights.EF and updating documentation

Modified: pkg/PortfolioAnalytics/R/charts.efficient.frontier.R
===================================================================
--- pkg/PortfolioAnalytics/R/charts.efficient.frontier.R	2013-09-05 01:41:28 UTC (rev 2995)
+++ pkg/PortfolioAnalytics/R/charts.efficient.frontier.R	2013-09-05 03:29:45 UTC (rev 2996)
@@ -55,7 +55,7 @@
 #' @param pch.assets plotting character of the assets, same as in \code{\link{plot}}
 #' @param cex.assets A numerical value giving the amount by which the asset points and labels should be magnified relative to the default.
 #' @author Ross Bennett
-#' @author Ross Bennett
+#' @aliases chart.EfficientFrontier.optimize.portfolio.ROI chart.EfficientFrontier.optimize.portfolio chart.EfficientFrontier.efficient.frontier
 #' @export
 chart.EfficientFrontier <- function(object, match.col, n.portfolios, ...){
   UseMethod("chart.EfficientFrontier")
@@ -269,35 +269,58 @@
   box(col = element.color)
 }
 
-#' chart weights along an efficient frontier
+# ' chart weights along an efficient frontier
+# ' 
+# ' This creates a stacked column chart of the weights of portfolios along an efficient frontier.
+# ' 
+# ' @param object object to chart.
+# ' @param \dots passthru parameters to \code{barplot}.
+# ' @param colorset color palette to use.
+# ' @param n.portfolios number of portfolios to extract along the efficient frontier.
+# ' This is only used for objects of class \code{optimize.portfolio}
+# ' @param by.groups TRUE/FALSE. If TRUE, the weights by group are charted.
+# ' @param match.col match.col string name of column to use for risk (horizontal axis).
+# ' Must match the name of an objective.
+# ' @param main main title used in the plot.
+# ' @param cex.lab The magnification to be used for x-axis and y-axis labels relative to the current setting of 'cex'.
+# ' @param cex.axis The magnification to be used for sizing the axis text relative to the current setting of 'cex', similar to \code{\link{plot}}.
+# ' @param cex.legend The magnification to be used for sizing the legend relative to the current setting of 'cex', similar to \code{\link{plot}}.
+# ' @param legend.labels character vector to use for the legend labels
+# ' @param element.color provides the color for drawing less-important chart elements, such as the box lines, axis lines, etc.
+# ' @param legend.loc NULL, "topright", "right", or "bottomright". If legend.loc is NULL, the legend will not be plotted.
+# ' @author Ross Bennett
+# ' @aliases chart.Weights.EF.efficient.frontier chart.Weights.EF.optimize.portfolio
+# ' @export
+
+#' Chart weights along an efficient frontier
 #' 
-#' This creates a stacked column chart of the weights of portfolios along an efficient frontier.
+#' This function is a generic method to chart weights along an efficient frontier
 #' 
-#' @param object object to chart.
-#' @param \dots passthru parameters to \code{barplot}.
-#' @param colorset color palette to use.
-#' @param n.portfolios number of portfolios to extract along the efficient frontier.
-#' This is only used for objects of class \code{optimize.portfolio}
-#' @param by.groups TRUE/FALSE. If TRUE, the weights by group are charted.
-#' @param match.col match.col string name of column to use for risk (horizontal axis).
-#' Must match the name of an objective.
-#' @param main main title used in the plot.
-#' @param cex.lab The magnification to be used for x-axis and y-axis labels relative to the current setting of 'cex'.
-#' @param cex.axis The magnification to be used for sizing the axis text relative to the current setting of 'cex', similar to \code{\link{plot}}.
-#' @param cex.legend The magnification to be used for sizing the legend relative to the current setting of 'cex', similar to \code{\link{plot}}.
-#' @param legend.labels character vector to use for the legend labels
-#' @param element.color provides the color for drawing less-important chart elements, such as the box lines, axis lines, etc.
-#' @param legend.loc NULL, "topright", "right", or "bottomright". If legend.loc is NULL, the legend will not be plotted.
-#' @author Ross Bennett
-#' @aliases chart.Weights.EF.efficient.frontier chart.Weights.EF.optimize.portfolio
+#' @param object object to chart
+#' @param \dots any other passthru parameters
 #' @export
 chart.Weights.EF <- function(object, ...){
   UseMethod("chart.Weights.EF")
 }
 
+#' Chart weights along an efficient frontier for an efficient.frontier object
+#' 
+#' @param object object of class \code{efficient.frontier}
+#' @param \dots passthru parameters to \code{barplot}.
+#' @param colorset color palette to use
+#' @param n.portfolios number of portfolios to extract along the efficient frontier
+#' @param by.groups TRUE/FALSE. If TRUE, the group weights are charted
+#' @param match.col string name of column to use for risk (horizontal axis). Must match the name of an objective.
+#' @param main title used in the plot.
+#' @param cex.lab The magnification to be used for x-axis and y-axis labels relative to the current setting of 'cex'
+#' @param cex.axis The magnification to be used for sizing the axis text relative to the current setting of 'cex', similar to \code{\link{plot}}
+#' @param cex.legend The magnification to be used for sizing the legend relative to the current setting of 'cex', similar to \code{\link{plot}}
+#' @param legend.labels character vector to use for the legend labels
+#' @param element.color provides the color for drawing less-important chart elements, such as the box lines, axis lines, etc.
+#' @param legend.loc NULL, "topright", "right", or "bottomright". If legend.loc is NULL, the legend will not be plotted
+#' @author Ross Bennett
 #' @method chart.Weights.EF efficient.frontier
 #' @S3method chart.Weights.EF efficient.frontier
-#' @export
 chart.Weights.EF.efficient.frontier <- function(object, ..., colorset=NULL, n.portfolios=25, by.groups=FALSE, match.col="ES", main="", cex.lab=0.8, cex.axis=0.8, cex.legend=0.8, legend.labels=NULL, element.color="darkgray", legend.loc="topright"){
   # using ideas from weightsPlot.R in fPortfolio package
   
@@ -420,9 +443,24 @@
   box(col=element.color)
 }
 
+#' Chart weights along an efficient frontier for an efficient.frontier object
+#' 
+#' @param object object of class \code{efficient.frontier}
+#' @param \dots passthru parameters to \code{barplot}.
+#' @param colorset color palette to use
+#' @param n.portfolios number of portfolios to extract along the efficient frontier
+#' @param by.groups TRUE/FALSE. If TRUE, the group weights are charted
+#' @param match.col string name of column to use for risk (horizontal axis). Must match the name of an objective.
+#' @param main title used in the plot.
+#' @param cex.lab The magnification to be used for x-axis and y-axis labels relative to the current setting of 'cex'
+#' @param cex.axis The magnification to be used for sizing the axis text relative to the current setting of 'cex', similar to \code{\link{plot}}
+#' @param cex.legend The magnification to be used for sizing the legend relative to the current setting of 'cex', similar to \code{\link{plot}}
+#' @param legend.labels character vector to use for the legend labels
+#' @param element.color provides the color for drawing less-important chart elements, such as the box lines, axis lines, etc.
+#' @param legend.loc NULL, "topright", "right", or "bottomright". If legend.loc is NULL, the legend will not be plotted
+#' @author Ross Bennett
 #' @method chart.Weights.EF optimize.portfolio
 #' @S3method chart.Weights.EF optimize.portfolio
-#' @export
 chart.Weights.EF.optimize.portfolio <- function(object, ..., colorset=NULL, n.portfolios=25, by.groups=FALSE, match.col="ES", main="", cex.lab=0.8, cex.axis=0.8, cex.legend=0.8, legend.labels=NULL, element.color="darkgray", legend.loc="topright"){
   # chart the weights along the efficient frontier of an objected created by optimize.portfolio
   

Modified: pkg/PortfolioAnalytics/man/chart.EfficientFrontier.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/chart.EfficientFrontier.Rd	2013-09-05 01:41:28 UTC (rev 2995)
+++ pkg/PortfolioAnalytics/man/chart.EfficientFrontier.Rd	2013-09-05 03:29:45 UTC (rev 2996)
@@ -1,5 +1,8 @@
 \name{chart.EfficientFrontier}
 \alias{chart.EfficientFrontier}
+\alias{chart.EfficientFrontier.efficient.frontier}
+\alias{chart.EfficientFrontier.optimize.portfolio}
+\alias{chart.EfficientFrontier.optimize.portfolio.ROI}
 \title{Chart the efficient frontier and risk-return scatter}
 \usage{
   chart.EfficientFrontier(object, match.col, n.portfolios,
@@ -100,7 +103,5 @@
 }
 \author{
   Ross Bennett
-
-  Ross Bennett
 }
 

Modified: pkg/PortfolioAnalytics/man/chart.Weights.EF.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/chart.Weights.EF.Rd	2013-09-05 01:41:28 UTC (rev 2995)
+++ pkg/PortfolioAnalytics/man/chart.Weights.EF.Rd	2013-09-05 03:29:45 UTC (rev 2996)
@@ -1,59 +1,16 @@
 \name{chart.Weights.EF}
 \alias{chart.Weights.EF}
-\alias{chart.Weights.EF.efficient.frontier}
-\alias{chart.Weights.EF.optimize.portfolio}
-\title{chart weights along an efficient frontier}
+\title{Chart weights along an efficient frontier}
 \usage{
   chart.Weights.EF(object, ...)
 }
 \arguments{
-  \item{object}{object to chart.}
+  \item{object}{object to chart}
 
-  \item{\dots}{passthru parameters to \code{barplot}.}
-
-  \item{colorset}{color palette to use.}
-
-  \item{n.portfolios}{number of portfolios to extract along
-  the efficient frontier. This is only used for objects of
-  class \code{optimize.portfolio}}
-
-  \item{by.groups}{TRUE/FALSE. If TRUE, the weights by
-  group are charted.}
-
-  \item{match.col}{match.col string name of column to use
-  for risk (horizontal axis). Must match the name of an
-  objective.}
-
-  \item{main}{main title used in the plot.}
-
-  \item{cex.lab}{The magnification to be used for x-axis
-  and y-axis labels relative to the current setting of
-  'cex'.}
-
-  \item{cex.axis}{The magnification to be used for sizing
-  the axis text relative to the current setting of 'cex',
-  similar to \code{\link{plot}}.}
-
-  \item{cex.legend}{The magnification to be used for sizing
-  the legend relative to the current setting of 'cex',
-  similar to \code{\link{plot}}.}
-
-  \item{legend.labels}{character vector to use for the
-  legend labels}
-
-  \item{element.color}{provides the color for drawing
-  less-important chart elements, such as the box lines,
-  axis lines, etc.}
-
-  \item{legend.loc}{NULL, "topright", "right", or
-  "bottomright". If legend.loc is NULL, the legend will not
-  be plotted.}
+  \item{\dots}{any other passthru parameters}
 }
 \description{
-  This creates a stacked column chart of the weights of
-  portfolios along an efficient frontier.
+  This function is a generic method to chart weights along
+  an efficient frontier
 }
-\author{
-  Ross Bennett
-}
 

Added: pkg/PortfolioAnalytics/man/chart.Weights.EF.efficient.frontier.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/chart.Weights.EF.efficient.frontier.Rd	                        (rev 0)
+++ pkg/PortfolioAnalytics/man/chart.Weights.EF.efficient.frontier.Rd	2013-09-05 03:29:45 UTC (rev 2996)
@@ -0,0 +1,60 @@
+\name{chart.Weights.EF.efficient.frontier}
+\alias{chart.Weights.EF.efficient.frontier}
+\title{Chart weights along an efficient frontier for an efficient.frontier object}
+\usage{
+  \method{chart.Weights.EF}{efficient.frontier} (object,
+    ..., colorset = NULL, n.portfolios = 25,
+    by.groups = FALSE, match.col = "ES", main = "",
+    cex.lab = 0.8, cex.axis = 0.8, cex.legend = 0.8,
+    legend.labels = NULL, element.color = "darkgray",
+    legend.loc = "topright")
+}
+\arguments{
+  \item{object}{object of class \code{efficient.frontier}}
+
+  \item{\dots}{passthru parameters to \code{barplot}.}
+
+  \item{colorset}{color palette to use}
+
+  \item{n.portfolios}{number of portfolios to extract along
+  the efficient frontier}
+
+  \item{by.groups}{TRUE/FALSE. If TRUE, the group weights
+  are charted}
+
+  \item{match.col}{string name of column to use for risk
+  (horizontal axis). Must match the name of an objective.}
+
+  \item{main}{title used in the plot.}
+
+  \item{cex.lab}{The magnification to be used for x-axis
+  and y-axis labels relative to the current setting of
+  'cex'}
+
+  \item{cex.axis}{The magnification to be used for sizing
+  the axis text relative to the current setting of 'cex',
+  similar to \code{\link{plot}}}
+
+  \item{cex.legend}{The magnification to be used for sizing
+  the legend relative to the current setting of 'cex',
+  similar to \code{\link{plot}}}
+
+  \item{legend.labels}{character vector to use for the
+  legend labels}
+
+  \item{element.color}{provides the color for drawing
+  less-important chart elements, such as the box lines,
+  axis lines, etc.}
+
+  \item{legend.loc}{NULL, "topright", "right", or
+  "bottomright". If legend.loc is NULL, the legend will not
+  be plotted}
+}
+\description{
+  Chart weights along an efficient frontier for an
+  efficient.frontier object
+}
+\author{
+  Ross Bennett
+}
+

Added: pkg/PortfolioAnalytics/man/chart.Weights.EF.optimize.portfolio.Rd
===================================================================
--- pkg/PortfolioAnalytics/man/chart.Weights.EF.optimize.portfolio.Rd	                        (rev 0)
+++ pkg/PortfolioAnalytics/man/chart.Weights.EF.optimize.portfolio.Rd	2013-09-05 03:29:45 UTC (rev 2996)
@@ -0,0 +1,60 @@
+\name{chart.Weights.EF.optimize.portfolio}
+\alias{chart.Weights.EF.optimize.portfolio}
+\title{Chart weights along an efficient frontier for an efficient.frontier object}
+\usage{
+  \method{chart.Weights.EF}{optimize.portfolio} (object,
+    ..., colorset = NULL, n.portfolios = 25,
+    by.groups = FALSE, match.col = "ES", main = "",
+    cex.lab = 0.8, cex.axis = 0.8, cex.legend = 0.8,
+    legend.labels = NULL, element.color = "darkgray",
+    legend.loc = "topright")
+}
+\arguments{
+  \item{object}{object of class \code{efficient.frontier}}
+
+  \item{\dots}{passthru parameters to \code{barplot}.}
+
+  \item{colorset}{color palette to use}
+
+  \item{n.portfolios}{number of portfolios to extract along
+  the efficient frontier}
+
+  \item{by.groups}{TRUE/FALSE. If TRUE, the group weights
+  are charted}
+
+  \item{match.col}{string name of column to use for risk
+  (horizontal axis). Must match the name of an objective.}
+
+  \item{main}{title used in the plot.}
+
+  \item{cex.lab}{The magnification to be used for x-axis
+  and y-axis labels relative to the current setting of
+  'cex'}
+
+  \item{cex.axis}{The magnification to be used for sizing
+  the axis text relative to the current setting of 'cex',
+  similar to \code{\link{plot}}}
+
+  \item{cex.legend}{The magnification to be used for sizing
+  the legend relative to the current setting of 'cex',
+  similar to \code{\link{plot}}}
+
+  \item{legend.labels}{character vector to use for the
+  legend labels}
+
+  \item{element.color}{provides the color for drawing
+  less-important chart elements, such as the box lines,
+  axis lines, etc.}
+
+  \item{legend.loc}{NULL, "topright", "right", or
+  "bottomright". If legend.loc is NULL, the legend will not
+  be plotted}
+}
+\description{
+  Chart weights along an efficient frontier for an
+  efficient.frontier object
+}
+\author{
+  Ross Bennett
+}
+



More information about the Returnanalytics-commits mailing list