urltoHtml {wikiTools} | R Documentation |
Convert a Wikipedia URL to an HTML link
Description
Convert a Wikipedia URL to an HTML link
Usage
urltoHtml(url, text = NULL)
Arguments
url |
Character vector of URLs. |
text |
A vector with name of the correspondent title of the url (See details). |
Details
This function converts an available URL direction to the corresponding HTML link, i.e., "https://es.wikipedia.org/wiki/Socrates" changes into "<a href='https://es.wikipedia.org/wiki/Socrates' target='_blank'>Socrates</a>
".
Value
A character vector of HTML links for the given urls.
Author(s)
Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/
Examples
## When you have a single URL:
urltoHtml("https://es.wikipedia.org/wiki/Socrates", text = "Socrates")
## It is possible to work with several items:
A <- c("https://es.wikipedia.org/wiki/Socrates",
"https://es.wikipedia.org/wiki/Plato",
"https://es.wikipedia.org/wiki/Aristotle")
urltoHtml (A, text = c("Socrates", "Plato", "Aristotle"))
## And you can also directly extract the info from nametoWikiURL():
urltoHtml(nametoWikiURL("Plato", "en"), "Plato" )
urltoHtml(nametoWikiURL(c("Plato", "Socrates", "Aristotle"), language="en"),
c("Plato", "Socrates", "Aristotle"))
[Package wikiTools version 1.2.7 Index]