preferred_choice.Rd
Select a vector element using a ranked set of preferences.
preferred_choice(x, preferences, default = 1, missing = NA)
Named vector of possible choices
Ranked vector of names of x
Element of x
if none of preferences
are names of x
Value returned instead of x[default]
, when default=0
or none of preferences
or default
exist in names(x)