Find if a string refers to a person, and if so, finds gender by searching Wikidata
find_gender(search, language = "en", description_language = "en", cache = TRUE, wait = 0.1, only_cached = FALSE, exclude_without_uppercase = TRUE, quietly = FALSE)
The query to be searched.
Two letters language codes to be passed to WikiData to determine search results; it works similarly as looking in the corresponding version of Wikipedia.
The language in which preferably to return the description as a two letter code. If not available, defaults to English. If English is not available, defaults to the language used to search in Wikidata. If not available, it returns NA.
Logical, defaults to TRUE. IF TRUE, it stores data on the search string and the resulting Wikidata object. Data are stored inside a `wikidata` folder (if it does not exist, it is automatically created).
Numeric, defaults to 0.1. Waiting time between queries, relevant when making a large number of queries.
Logical, defaults to FALSE. If TRUE, it only uses locally cached information.
Logical, degaults to TRUE. If the search string does not include any upper case letter, then assume it's not a person.
Logical, defaults to FALSE. If TRUE, no warning message appears when no relevent Wikidata entry is found.
A data.frame (a tibble) with one row and four columns: Query, Gender, Description, and WikidataID
find_gender(search = "Garibaldi", language = "it")#> # A tibble: 1 x 4 #> Query Gender Description WikidataID #> <chr> <chr> <chr> <chr> #> 1 Garibaldi male Italian general and politician Q539