searchWiki: Find if there is a Wikipedia page of a name(s) in the...

View source: R/wikiTools.R

searchWikiR Documentation

Find if there is a Wikipedia page of a name(s) in the selected language.

Description

Find if there is a Wikipedia page of a name(s) in the selected language.

Usage

searchWiki(
  name,
  language = c("en", "es", "fr", "it", "de", "pt", "ca"),
  all = FALSE,
  maxtime = 0
)

Arguments

name

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

language

The language of the Wikipedia page version. This should consist of an ISO language code.

all

If all, all the languages are checked. If false, once a term is found, there is no search of others, so it's faster.

maxtime

In case you want to apply a random waiting between consecutive searches.

Details

This function checks any page or entry in order to find if it has a Wikipedia page in a given language. It manages the different the languages of Wikipedia thru the two-letters abbreviated language parameter, i.e, "en" = "english". It is possible to check multiple languages in order of preference; in this case, only the first available language will appear as TRUE.

Value

A Boolean data frame of TRUE or FALSE.

Author(s)

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

Examples

## When you want to check an entry in a single language:
searchWiki("Manuel Vilas", language = "es")

## When you want to check an entry in several languages:
## Not run: 
searchWiki("Manuel Vilas", language = c( "en", "es", "fr", "it", "de", "pt", "ca"), all=TRUE)

## End(Not run)
## Not run: 
A<-c("Manuel Vilas", "Julia Navarro", "Rosa Montero")
searchWiki(A, language = c("en", "es", "fr", "it", "de", "pt", "ca"), all=FALSE)

## End(Not run)

wikiTools documentation built on March 24, 2022, 9:05 a.m.