GenderGuesser

An R package for using the genderize.io API to guess the gender of names.
git clone https://git.eamoncaddigan.net/GenderGuesser.git
Log | Files | Refs | README | LICENSE

commit 23920ff3fb43614306b103c7fac08f462bf5b80e
parent 078b50d5af1e261fd668ff603730afafeaf1a5ef
Author: eamoncaddigan <eamon.caddigan@gmail.com>
Date:   Tue, 11 Aug 2015 20:25:06 -0400

A vignette!

Diffstat:
MDESCRIPTION | 8+++++---
Avignettes/GenderGuesser.Rmd | 37+++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION @@ -4,10 +4,12 @@ Version: 0.0.0.9000 Authors@R: person("Eamon", "Caddigan", email = "eamon.caddigan@gmail.com", role = c("aut", "cre")) Description: Currently uses the genderize.io API to guess the gender of one or more names. Depends: R (>= 3.2.1) -Imports: +Imports: httr (>= 1.0.0), jsonlite -Suggests: - devtools +Suggests: + devtools, + knitr License: GPL-3 LazyData: true +VignetteBuilder: knitr diff --git a/vignettes/GenderGuesser.Rmd b/vignettes/GenderGuesser.Rmd @@ -0,0 +1,37 @@ +--- +title: "Using GenderGuesser" +author: "Eamon Caddigan" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Vignette Title} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +GenderGuesser uses the API at [genderize.io](https://genderize.io) to guess the gender of a name. Right now, GenderGuesser only exports a single function, `guessGender`. Calling this function returns a `data.frame` containing the results from [genderize.io](https://genderize.io). + +```{r} +library("GenderGuesser") + +# Call with a single name +guessGender("Natalie") + +# Call with multiple names +guessGender(c("Liam", "Taidghin", "Eamon", "Sean")) +``` + +[genderize.io](https://genderize.io) can refine results based on language or country. + +```{r} +# "Kim" is usually a female name in the US +guessGender("Kim", countryCode = "US") + +# But "Kim" is usually a male name in Denmark (use the ISO 3166-1 alpha-2 country code) +guessGender("Kim", countryCode = "DK") + +# You can use the ISO 639-1 language code instead +guessGender("Kim", languageCode = "da") +``` + +You can purchase an API key from [genderize.io](https://genderize.io) to get around their rate limit (100 names per day). Pass it to the function using the `apiKey` argument.