predictrace (version 1.0.0)

predict_race: Find the race of a surname

Description

Find the race of a surname

Usage

predict_race(name, probability = TRUE)

Arguments

name

String or vector of strings of surname that you want to know the race of.

probability

If TRUE (default) will provide columns for each race with the probability that the surname is of that race. If FALSE, will only return the name, the match-name from the Census data, and the most likely race.

Value

A data.frame with three or nine columns: The first column has the name as inputted, the second column has the cleaned up name (no spaces or punctuation, all lowercase), the third column tells the likely race of the surname. If the parameter probability is false, these three columns are all that is returned. Otherwise, columns 4-9 tell the specific probability that the surname is each race.

Examples

Run this code
# NOT RUN {
predict_race("franklin")

predict_race(c("franklin", "Washington", "Jefferson", "Sotomayor", "Liu"))
predict_race("franklin", probability = FALSE)
# }

Run the code above in your browser using DataLab