Useful helper for logging. For discrete parameter values always the name of the discrete value is used.
paramValueToString(par, x, show.missing.values = FALSE, num.format = "%.3g")
par | |
---|---|
x | (any) |
show.missing.values | ( |
num.format | ( |
p = makeNumericParam("x") paramValueToString(p, 1) paramValueToString(p, 1.2345) paramValueToString(p, 0.000039) paramValueToString(p, 8.13402, num.format = "%.2f") p = makeIntegerVectorParam("x", len = 2) paramValueToString(p, c(1L, 2L)) p = makeLogicalParam("x") paramValueToString(p, TRUE) p = makeDiscreteParam("x", values = list(a = NULL, b = 2)) paramValueToString(p, NULL) ps = makeParamSet( makeNumericVectorParam("x", len = 2L), makeDiscreteParam("y", values = list(a = NULL, b = 2)) ) paramValueToString(ps, list(x = c(1, 2), y = NULL))#> [1] "x=1,2; y=a"