convert_data_continuous {DEXiR} | R Documentation |
A helper function for converting individual columns of alternatives' data.
It is assumed that data
contains numeric data corresponding to a continuous
DexiAttribute. During conversion,
values are optionally converted from some interval to another, using lin_map()
, and/or
reversed using reverse_value()
for scales whose $order = "descending"
.
convert_data_continuous(
data,
scale,
imin = NULL,
imax = NULL,
omin = 0,
omax = 1,
map_values = TRUE,
reverse_descending = TRUE
)
data |
A vector containing floating point numbers.
Typically a |
scale |
A DexiContinuousScale object or a continuous DexiAttribute object. |
imin |
Lower input bound. Default: determined as |
imax |
Upper input bound. Default: determined as |
omin |
Lower output bound for |
omax |
Upper output bound for |
map_values |
|
reverse_descending |
|
numeric()
. Vector of converted values.
scl <- DexiContinuousScale()
convert_data_continuous(c(1, 2, 5), scl) # c(0.0, 0.25, 1.00)
convert_data_continuous(c(1, 2, 5), scl, imin = 0, imax = 10, omin = 0, omax = 100)
# c(10, 20, 50)