Add an NA hspanicr column if one doesn't exist
Source:R/add_hspanicr_column.R
add_hspanicr_column.RdHispanic origin was not recorded until 1989. In order to keep all dataframes conformable, add an NA column named hspanicr if one does not exist.
See also
add_hispanic_origin, which adds the binary
hispanic_origin column (for population joins) derived from
hspanicr; this function only backfills the raw hspanicr field.
Examples
df <- data.frame(year = 2019, ucod = "X42")
add_hspanicr_column(df)
#> year ucod hspanicr
#> 1 2019 X42 NA