Return defaults of single parameters or parameters in a parameter set or a list of parameters.
getDefaults(obj, include.null = FALSE, dict = NULL)
obj | ( |
---|---|
include.null | ( |
dict | ( |
named list
. Named (and in case of a ParamSet()
, in the same order).
Parameters without defaults are not present in the list.
ps1 = makeParamSet( makeDiscreteParam("x", values = c("a", "b"), default = "a"), makeNumericVectorParam("y", len = 2), makeIntegerParam("z", default = 99) ) getDefaults(ps1, include.null = TRUE)#> $x #> [1] "a" #> #> $y #> NULL #> #> $z #> [1] 99 #>ps2 = makeParamSet( makeNumericVectorParam("a", len = expression(k), default = expression(p)), makeIntegerParam("b", default = 99), makeLogicalParam("c") ) getDefaults(ps2, dict = list(k = 3, p = 5.4))#> $a #> [1] 5.4 5.4 5.4 #> #> $b #> [1] 99 #>