Skip to contents

Looks up the registered order for a column: an exact vars match wins, otherwise the first matching prefixes entry. Used internally by calc_percentage() to apply orders automatically; exposed so you can check what would be applied.

Usage

order_for(var)

Arguments

var

A column name.

Value

The matching level vector, or NULL if none is registered.

Examples

register_order("edu", c("low", "mid", "high"), prefixes = "edu_")
order_for("edu_level")
#> [1] "low"  "mid"  "high"
remove_order("edu")