Learn R Programming

wikiTools (version 1.2.8)

nametoWikiHtml: Create the Wikipedia link of a name or entry.

Description

Create the Wikipedia link of a name or entry.

Usage

nametoWikiHtml(name, language = "en")

Value

A character vector of names' links.

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 (default = "en").

Author

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

Details

This function adds the Wikipedia's html link to a entry or name, i.e., "Max Weber" converts into "<a href='https://es.wikipedia.org/wiki/Max_Weber' target='_blank'>Max Weber</a>". It also manages different the languages of Wikipedia through the abbreviated two-letter language parameter, i.e., "en" = "english".

Examples

Run this code
## When extracting a single item;
nametoWikiHtml("Computer", language = "en")

## When extracting two objetcs;
A <- c("Computer", "Operating system")
nametoWikiHtml(A)
B <- c("Socrates", "Plato","Aristotle" )
nametoWikiHtml(B)

Run the code above in your browser using DataLab