expand_value_to_points {DEXiR} | R Documentation |
Expand a DEXi value
to a sequence of individual elements (points).
Particularly aimed for graphic functions that display DEXi values
with dots of different sizes and colors.
expand_value_to_points(value, scale, colors = c("red", "black", "green"))
value |
A DEXi value: a single value (integer or float), a set (integer vector) or a distribution. |
scale |
A DexiScale object. |
colors |
|
A data.frame
consisting of:
points
numeric()
. value
expanded to a vector of ordinal values.
sizes
numeric()
. Numeric values assigned to each corresponding ordinal values.
Normally 1.0
for set elements and in the (0,1]
interval for distribution membership values.
colors
Colors assigned to corresponding value qualities.
scl <- DexiDiscreteScale(values = c("L", "M", "H"))
expand_value_to_points(c(1, 3), scl)
# points sizes colors
# 1 1 1 red
# 2 3 1 green
expand_value_to_points(distribution(0.1, 0, 0.9), scl)
# points sizes colors
# 1 1 0.1 red
# 2 3 0.9 green