Learn R Programming

wikiTools (version 1.2.14)

getWikiData: Create a data.frame with Wikidata of a vector of names.

Description

Create a data.frame with Wikidata of a vector of names.

Usage

getWikiData(names, language = "en", csv = NULL)

Value

A data frame with personal information of the names or a csv file with the information separated by semicolons.

Arguments

names

A vector consisting of one or more Wikidata's entry (i.e., topic or person).

language

The language of the Wikipedia page version. This should consist of an ISO language code (default = "en").

csv

A file name to save the results, in which case the only return is a message with the name of the saved file.

Author

Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/

Examples

Run this code
## Obtaining information in English Wikidata
if (FALSE) {
names <- c("William Shakespeare", "Pedro Almodovar")
info <- getWikiData(names)
## Obtaining information in Spanish Wikidata
d <- getWikiData(names, language="es")
}

Run the code above in your browser using DataLab