Coerces a vector of Employer Identification Numbers (EINs) to the canonical IRS display format `XX-XXXXXXX` (10 characters, two digits, hyphen, seven digits). Useful for users joining external data (CSV exports, spreadsheets, API responses) against the BMF returned by [nccs_read()], whose `ein` column is already normalized upstream.
Value
A character vector the same length as `x`, with each element either in `XX-XXXXXXX` form or `NA_character_`.
Details
The function strips all non-digit characters, left-pads to nine digits with zeros (to recover EINs that lost a leading zero during numeric coercion), and inserts the hyphen at position 3. Values that cannot be reduced to a non-empty digit string of nine or fewer characters become `NA_character_`.
Pure base-R, no side effects, no in-place mutation.