A numerical expression (for around and between) or an arbitrary expression (for pos and layered).
We search for value where expr evaluates to a value in the preferred interval, layer, etc.
center
Preferred value for around.
left
Lower limit of the preferred interval for between.
right
Upper limit of the preferred interval for between.
pos_value
A vector containing the preferred values for a pos preference.
Has to be of the same type (numeric, logical, character, ...) as expr.
...
Layers (sets) for a layered preference, where the first set are the most preferred values.
# Search for cars where mpg is near to 25psel(mtcars, around(mpg, 25))
# cyl = 2 and cyl = 4 are equally good, cyl = 6 is worsepsel(mtcars, layered(cyl, c(2, 4), 6))