Make a ranked choice

preferred_choice(x, preferences, default = 1)

Arguments

x

Named vector of possible choices

preferences

Ranked vector of names of x

default

Element of x if none of preferences are names of x