Class for converting parameter values back and forth to the unit range
encode_unit(x, value, direction, ...)# S3 method for quant_param
encode_unit(x, value, direction, original = TRUE, ...)
# S3 method for qual_param
encode_unit(x, value, direction, ...)
A vector of values.
A param
object.
The original values should be either numeric or character. When
converting back, these should be on [0, 1]
.
Either "forward" (to [0, 1]
) or "backward".
A logical; should the values be transformed into their natural units.
For integer parameters, the encoding can be lossy.