Assign a coarse role to standardized titles
classify_title_role.RdVectorized classifier mapping each title.standard value to one of
BOARD, OFFICER, STAFF, OTHER (see title_role). Precedence is
overrides, then BOARD, then OFFICER, then STAFF, then OTHER.
Arguments
- title
Character vector of titles (any case; whitespace is squished).
- overrides
Optional named character vector mapping an exact normalized title to a role, e.g.
c("SERGEANT AT ARMS" = "BOARD"). Overrides win over every rule, so this is the one-line escape hatch for tail cases the rules get wrong. Names are matched after the same normalization applied totitle.- levels
If
TRUE(default) return a factor with levelsc("BOARD","OFFICER","STAFF","OTHER"); otherwise a character vector.
See also
title_role_coverage() to audit a whole vocabulary.
Examples
classify_title_role(c("BOARD PRESIDENT", "BOARD SECRETARY", "TREASURER",
"CHIEF FINANCIAL OFFICER", "EXECUTIVE DIRECTOR",
"VICE PRESIDENT", "VICE PRESIDENT OF FINANCE",
"DIRECTOR OF MARKETING", "CHAPLAIN"))
#> [1] BOARD BOARD BOARD OFFICER OFFICER BOARD STAFF STAFF OTHER
#> Levels: BOARD OFFICER STAFF OTHER