Learn R Programming

DEXiR (version 1.0.2)

expand_value_to_points: expand_value_to_points

Description

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.

Usage

expand_value_to_points(value, scale, colors = c("red", "black", "green"))

Value

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.

Arguments

value

A DEXi value: a single value (integer or float), a set (integer vector) or a distribution.

scale

A DexiScale object.

colors

numeric(3) representing colors to display "bad", "neutral" and "good" values, respectively.

Examples

Run this code
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

Run the code above in your browser using DataLab