MyNixOS website logo
Description

Extrapolate Gender, Age and Nationality of a Name.

Connects to the <https://genderize.io/>, <https://agify.io/> and <https://nationalize.io/> APIs to estimate gender, age and nationality of a first name.

DemografixeR

CRANstatus Travis buildstatus AppVeyor buildstatus Codecov testcoverage

‘DemografixeR’ allows to estimate gender, age & nationality from a name. The package is an API wrapper of all 3 ‘Demografix’ API’s - all three APIs supported in one package:

Documentation

You can find all the necessary documentation about the package here:

Installation

You can install the CRAN release version of DemografixeR following this R command:

install.packages("DemografixeR")

You can also install the development version of DemografixeR following these R commands:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("matbmeijer/DemografixeR")

Examples

These are basic examples, which shows you how to estimate nationality, gender and age by a given name with & without specifying a country. The package takes care of multiple background tasks:

  • API pagination
  • Duplicated names (one request made per name)
  • Missing values
  • Workflow integration (e.g. with dplyr or data.table)
library(DemografixeR)

#Simple example without country_id
names<-c("Ben", "Allister", "Lucie", "Paula")
genderize(name = names)
#> [1] "male"   "male"   "female" "female"
nationalize(name = names)
#> [1] "AU" "ZA" "CZ" "PT"
agify(name = names)
#> [1] 48 44 24 50

#Simple example with
genderize(name = names, country_id = "US")
#> [1] "male"   "male"   "female" "female"
agify(name = names, country_id = "US")
#> [1] 67 46 65 70

#Workflow example with dplyr with missing values and multiple different countries
df<-data.frame(names=c("Ana", NA, "Pedro",
                       "Francisco", "Maria", "Elena"),
                 country=c(NA, NA, "ES",
                           "DE", "ES", "NL"), stringsAsFactors = FALSE)

df %>% dplyr::mutate(guessed_nationality=nationalize(name = names),
                guessed_gender=genderize(name = names, country_id = country),
                guessed_age=agify(name = names, country_id = country)) %>% 
  knitr::kable()
namescountryguessed_nationalityguessed_genderguessed_age
AnaNAPTfemale58
NANANANANA
PedroESPTmale69
FranciscoDECLmale58
MariaESCYNA59
ElenaNLCCfemale69

#Detailed data.frame example:
genderize(name = names, simplify = FALSE, meta = TRUE) %>% knitr::kable()
nametypegenderprobabilitycountapi_rate_limitapi_rate_remainingapi_rate_resetapi_request_timestamp
2Bengendermale0.9577991100083152142020-05-04 22:33:05
1Allistergendermale0.98129100083152142020-05-04 22:33:05
3Luciegenderfemale0.9985580100083152142020-05-04 22:33:05
4Paulagenderfemale0.9874130100083152142020-05-04 22:33:05

Disclaimer

  • This package is in no way affiliated to the Demografix ApS company, the owner of the ‘genderize.io’, ‘agify.io’ and ‘nationalize.io’ APIs.
  • An open mind towards gender & gender diversity is promoted, warning that the results from the ‘genderize.io’ API reflect an oversimplification of gender identity, gender roles and the meaning of ‘gender’. For more information visit the active discussion in the following Wikipedia article.

Code of Conduct

Please note that the ‘DemografixeR’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

MIT © Matthias Brenninkmeijer.

Metadata

Version

0.1.1

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows