trafoValue | R Documentation |
Transform a value with associated transformation function(s).
trafoValue(par, x)
par |
(Param | ParamSet) |
x |
(any) |
Transformed value.
# transform simple parameter: p = makeNumericParam(id = "x", trafo = function(x) x^2) trafoValue(p, 2) # for a parameter set different transformation functions are possible: ps = makeParamSet( makeIntegerParam("u", trafo = function(x) 2 * x), makeNumericVectorParam("v", len = 2, trafo = function(x) x / sum(x)), makeDiscreteParam("w", values = c("a", "b")) ) # now the values of "u" and "v" are transformed: trafoValue(ps, list(3, c(2, 4), "a"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.