In addition to the base preferences, rPref offers some macros to define preferences where a given interval or point is preferred.
1 2 3 4 5 6 7
A numerical expression (for
Preferred numerical value for
(optional) Data frame for partial evaluation and association of preference and data set.
Lower limit (numerical) of the preferred interval for
Upper limit (numerical) of the preferred interval for
A vector containing the preferred values for a
Layers (sets) for a
between(expr, left, right)
Those tuples are preferred where
to a value between
For values not in this interval, the values nearest to the interval are preferred.
between(expr, center, center).
Those tuples are preferred, where
to a value which is contained in
layered(expr, layer1, layer2, ..., layerN)
For the most preferred tuples
must evaluate to a value in
The second-best tuples are those where
expr evaluates to a value in
layer2 and so forth.
Values occurring in none of the layers are considered worse than those in
Technically, this is realized by a prioritization chain (lexicographical order)
Note that only the argument
expr may contain columns from the data frame,
all other variables must evaluate to explicit values.
around(mpg, mean(mpg)) is not allowed. In this case, one can use
around(mpg, mean(mtcars$mpg)) instead. Or alternatively, without using the base preference macros,
low(abs(mpg - mean(mpg))) does the same. There, the actual mean value of
mpg is calculated
just when the preference selection via
psel is called.
1 2 3 4 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.