Skip to contents

Get the rank assigned to a specific item in a set of preferences.

Usage

pref_get_rank(x, item_name)

Arguments

x

A vector of preferences.

item_name

The name of the item to extract the rank for.

Value

The rank of item_name for each of the preferences in x.

Examples

pref_get_rank(preferences(c("a > b > c", "b > c = a", "")), "a")
#> [1]  1  2 NA