[Blotter-commits] r1561 - pkg/quantstrat/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Nov 1 16:51:45 CET 2013
Author: bodanker
Date: 2013-11-01 16:51:45 +0100 (Fri, 01 Nov 2013)
New Revision: 1561
Modified:
pkg/quantstrat/R/indicators.R
pkg/quantstrat/R/initialize.R
pkg/quantstrat/R/rules.R
pkg/quantstrat/R/signals.R
pkg/quantstrat/R/wrapup.R
Log:
- update modify.args handling of '...'
Modified: pkg/quantstrat/R/indicators.R
===================================================================
--- pkg/quantstrat/R/indicators.R 2013-10-31 12:14:45 UTC (rev 1560)
+++ pkg/quantstrat/R/indicators.R 2013-11-01 15:51:45 UTC (rev 1561)
@@ -172,9 +172,11 @@
.formals <- formals(indicator$name)
.formals <- modify.args(.formals, indicator$arguments, dots=TRUE)
# now add arguments from parameters
- .formals <- modify.args(.formals, parameters)
+ .formals <- modify.args(.formals, parameters, dots=TRUE)
# now add dots
- .formals <- modify.args(.formals, ...)
+ .formals <- modify.args(.formals, NULL, ..., dots=TRUE)
+ # remove ... to avoid matching multiple args
+ .formals$`...` <- NULL
tmp_val <- do.call(indicator$name, .formals)
Modified: pkg/quantstrat/R/initialize.R
===================================================================
--- pkg/quantstrat/R/initialize.R 2013-10-31 12:14:45 UTC (rev 1560)
+++ pkg/quantstrat/R/initialize.R 2013-11-01 15:51:45 UTC (rev 1561)
@@ -98,9 +98,11 @@
.formals <- formals(init_o$name)
.formals <- modify.args(.formals, init_o$arguments, dots=TRUE)
# now add arguments from parameters
- .formals <- modify.args(.formals, parameters)
+ .formals <- modify.args(.formals, parameters, dots=TRUE)
# now add dots
- .formals <- modify.args(.formals, ...)
+ .formals <- modify.args(.formals, NULL, ..., dots=TRUE)
+ # remove ... to avoid matching multiple args
+ .formals$`...` <- NULL
do.call(init_o$name, .formals)
}
Modified: pkg/quantstrat/R/rules.R
===================================================================
--- pkg/quantstrat/R/rules.R 2013-10-31 12:14:45 UTC (rev 1560)
+++ pkg/quantstrat/R/rules.R 2013-11-01 15:51:45 UTC (rev 1561)
@@ -693,9 +693,11 @@
.formals <- formals(rule$name)
.formals <- modify.args(.formals, rule$arguments, dots=TRUE)
# now add arguments from parameters
- .formals <- modify.args(.formals, parameters)
+ .formals <- modify.args(.formals, parameters, dots=TRUE)
# now add dots
- .formals <- modify.args(.formals, ..., dots=TRUE)
+ .formals <- modify.args(.formals, NULL, ..., dots=TRUE)
+ # remove ... to avoid matching multiple args
+ .formals$`...` <- NULL
# any rule-specific prefer-parameters should override global prefer parameter
if(!is.null(rule$arguments$prefer)) .formals$prefer = rule$arguments$prefer
Modified: pkg/quantstrat/R/signals.R
===================================================================
--- pkg/quantstrat/R/signals.R 2013-10-31 12:14:45 UTC (rev 1560)
+++ pkg/quantstrat/R/signals.R 2013-11-01 15:51:45 UTC (rev 1561)
@@ -103,9 +103,11 @@
.formals <- formals(signal$name)
.formals <- modify.args(.formals, signal$arguments, dots=TRUE)
# now add arguments from parameters
- .formals <- modify.args(.formals, parameters)
+ .formals <- modify.args(.formals, parameters, dots=TRUE)
# now add dots
- .formals <- modify.args(.formals, ...)
+ .formals <- modify.args(.formals, NULL, ..., dots=TRUE)
+ # remove ... to avoid matching multiple args
+ .formals$`...` <- NULL
tmp_val <- do.call(signal$name, .formals)
Modified: pkg/quantstrat/R/wrapup.R
===================================================================
--- pkg/quantstrat/R/wrapup.R 2013-10-31 12:14:45 UTC (rev 1560)
+++ pkg/quantstrat/R/wrapup.R 2013-11-01 15:51:45 UTC (rev 1561)
@@ -113,9 +113,11 @@
.formals <- formals(wrapup_o$name)
.formals <- modify.args(.formals, wrapup_o$arguments, dots=TRUE)
# now add arguments from parameters
- .formals <- modify.args(.formals, parameters)
+ .formals <- modify.args(.formals, parameters, dots=TRUE)
# now add dots
- .formals <- modify.args(.formals, ...)
+ .formals <- modify.args(.formals, NULL, ..., dots=TRUE)
+ # remove ... to avoid matching multiple args
+ .formals$`...` <- NULL
out[[wrapup_o$name]] <- do.call(wrapup_o$name, .formals)
}
More information about the Blotter-commits
mailing list