name.clean cleans surnames in user-input dataset and merges in racial
distributions from the Census Surname List and Census Spanish Surname List.
name.clean(voters)data.frame. Must contain a field
named 'surname'.data.frame. It will
consist of the original user-input data with additional columns that
specify the part of the name matched with Census data (surname.match),
and the probabilities Pr(Race | Surname) for each racial group
(p_whi for Whites, p_bla for Blacks,
p_his for Hispanics/Latinos, p_asi for Asians, and
p_oth for Others).
data(voters)
name.clean(voters)
Run the code above in your browser using DataLab