powered by
Predict ethnicity either by last names or both first and last names. This is the default and recommended method for prediction.
predict_ethnicity( firstnames = NULL, lastnames = NULL, method = "fullname", threads = 0, na.rm = FALSE )
data.frame with probability of being each ethnic group and the predicted group (one with highest probability)
A character vector of first names. Default to NULL. Only use this if you are using 'method' = 'fullname'.
A character vector of last names. Default to NULL. Use this in both 'fullname' and 'lastname' methods.
"fullname" or "lastname". Inference method to choose from.
single integer. Number of threads to use for multi-threading.
TRUE or FALSE (bool). If TRUE, then the NAs will be removed; if FALSE, then return error if there is NA in the arguments.
predict_ethnicity(firstnames = "Alan", lastnames = "Turing")
Run the code above in your browser using DataLab