NCHS changed the sex coding at data year 2003: 1979-2002 use a numeric code (`1` = male, `2` = female); 2003 onward use a character code (`"M"`, `"F"`). This maps either scheme to the strings `"male"` / `"female"` (and `NA` for anything else), matching the `sex` labels used by [pop_est] so downstream population joins need no relabeling.
Details
The era is taken from `year` when supplied (authoritative). When `year` is `NULL`, the era is inferred from the column's type – a numeric column is the pre-2003 scheme, a character column the 2003+ scheme – with a warning; pass `year` to be explicit (a character `"1"`/`"2"` re-read from a CSV would otherwise be treated as the modern scheme and map to `NA`).