R/evaluateParamExpressions.R
evaluateParamExpressions.Rd
Evaluates the expressions of a parameter, parameter set or list of parameters for a given dictionary.
evaluateParamExpressions(obj, dict = NULL)
obj | ( |
---|---|
dict | ( |
[Param()
| ParamHelpers::ParamSet()
| list
].
ps = makeParamSet( makeNumericParam("x", lower = expression(p), upper = expression(ceiling(3 * p))), makeIntegerParam("y", lower = 1, upper = 2) ) evaluateParamExpressions(ps, dict = list(p = 3))#> Type len Def Constr Req Tunable Trafo #> x numeric - - 3 to 9 - TRUE - #> y integer - - 1 to 2 - TRUE -ps = makeParamSet( makeNumericParam("x", default = expression(sum(data$Species == "setosa"))), makeIntegerParam("y", lower = 1, upper = 2), keys = c("data", "Species") ) evaluateParamExpressions(ps, dict = list(data = iris))#> Type len Def Constr Req Tunable Trafo #> x numeric - 50 -Inf to Inf - TRUE - #> y integer - - 1 to 2 - TRUE -#> $x #> [1] 3 #> #> $y #> [1] 5 #>