View source: R/predict_ethnicity.R
predict_ethnicity | R Documentation |
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
)
firstnames |
A character vector of first names. Default to NULL. Only use this if you are using 'method' = 'fullname'. |
lastnames |
A character vector of last names. Default to NULL. Use this in both 'fullname' and 'lastname' methods. |
method |
"fullname" or "lastname". Inference method to choose from. |
threads |
single integer. Number of threads to use for multi-threading. |
na.rm |
TRUE or FALSE (bool). If TRUE, then the NAs will be removed; if FALSE, then return error if there is NA in the arguments. |
data.frame with probability of being each ethnic group and the predicted group (one with highest probability)
predict_ethnicity(firstnames = "Alan", lastnames = "Turing")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.