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

GenderGuesser.Rmd (1259B)


      1 ---
      2 title: "Using GenderGuesser"
      3 author: "Eamon Caddigan"
      4 date: "`r Sys.Date()`"
      5 output: rmarkdown::html_vignette
      6 vignette: >
      7   %\VignetteIndexEntry{Vignette Title}
      8   %\VignetteEngine{knitr::rmarkdown}
      9   %\VignetteEncoding{UTF-8}
     10 ---
     11 
     12 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).
     13 
     14 ```{r}
     15 library("GenderGuesser")
     16 
     17 # Call with a single name
     18 guessGender("Natalie")
     19 
     20 # Call with multiple names
     21 guessGender(c("Liam", "Taidghin", "Eamon", "Sean"))
     22 ```
     23 
     24 [genderize.io](https://genderize.io) can refine results based on language or country.
     25 
     26 ```{r}
     27 # "Kim" is usually a female name in the US
     28 guessGender("Kim", countryCode = "US")
     29 
     30 # But "Kim" is usually a male name in Denmark (use the ISO 3166-1 alpha-2 country code)
     31 guessGender("Kim", countryCode = "DK")
     32 
     33 # You can use the ISO 639-1 language code instead
     34 guessGender("Kim", languageCode = "da")
     35 ```
     36 
     37 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.