[Returnanalytics-commits] r2486 - pkg/PortfolioAnalytics/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jul 2 06:07:16 CEST 2013
Author: rossbennett34
Date: 2013-07-02 06:07:16 +0200 (Tue, 02 Jul 2013)
New Revision: 2486
Modified:
pkg/PortfolioAnalytics/R/constraints.R
Log:
changing max.pos to max_pos to be consistent with naming e.g., min_sum, max_sum, etc.
Modified: pkg/PortfolioAnalytics/R/constraints.R
===================================================================
--- pkg/PortfolioAnalytics/R/constraints.R 2013-07-02 04:04:06 UTC (rev 2485)
+++ pkg/PortfolioAnalytics/R/constraints.R 2013-07-02 04:07:16 UTC (rev 2486)
@@ -631,7 +631,7 @@
#' Allows the user to specify the maximum number of positions (i.e. number of assets with non-zero weights)
#'
#' @param type character type of the constraint
-#' @param max.pos maximum number of positions
+#' @param max_pos maximum number of positions
#' @param enabled TRUE/FALSE
#' @param \dots any other passthru parameters to specify box and/or group constraints
#' @author Ross Bennett
@@ -641,11 +641,11 @@
#'
#' pspec <- portfolio.spec(assets=colnames(ret))
#'
-#' pspec <- add.constraint(portfolio=pspec, type="position_limit", max.pos=3)
+#' pspec <- add.constraint(portfolio=pspec, type="position_limit", max_pos=3)
#' @export
-position_limit_constraint <- function(type, max.pos, enabled=FALSE, ...){
+position_limit_constraint <- function(type, max_pos, enabled=FALSE, ...){
Constraint <- constraint_v2(type, enabled=enabled, constrclass="position_limit_constraint", ...)
- Constraint$max.pos <- max.pos
+ Constraint$max_pos <- max_pos
return(Constraint)
}
More information about the Returnanalytics-commits
mailing list