get_ethnicities: Classifies names based on 6 U.S. ethnicities

Description Usage Arguments Value Author(s) Examples

Description

Returns an object that classifies any inputted name(s) according to 6 different U.S. ethnicities.

Usage

1

Arguments

x

A vector of names, in the form "First_name Last_name". If there are multiple segments separated by white spaces, only the first and the last segments are taken into account.

t

A string with the API access token. The default value is NULL, although you must set your own token. A Name-Prism API token can be obtained for research purposes to overcome the limit of anonymous API use. Please visit http://www.name-prism.com/api for more details.

warnings

Logical. If TRUE, then a warning message will be displayed when a name cannot be analyzed. The default value is FALSE.

Value

A data frame of dimensions length(x)*9, with the probability of belonging to each of the 6 different U.S. ethnicities. Errors (e.g. connection is interrupted, invalid tokens) are handled as NA.

Author(s)

Charles Crabtree ccrabtr@umich.edu and Christian Chacua christian-mauricio.chacua-delgado@u-bordeaux.fr

Examples

1
2
3
4
5
6
# Vector of names.
x <- c("Charles Crabtree", "Volha Chykina", "Christian Chacua", "Christian Mauricio Chacua")
# Using the API token a1a2a34aa56789aa (you should get your own token)
y <- get_ethnicities(x, t="a1a2a34aa56789aa", warnings=FALSE)
y
# "Christian Chacua" and "Christian Mauricio Chacua" have the same probabilities as "Mauricio" is not taken into account.

cdcrabtree/nomine documentation built on May 31, 2019, 8:40 a.m.