urltoHtml | R Documentation |
Convert a Wikipedia URL to an HTML link
urltoHtml(url, text = NULL)
url |
Character vector of URLs. |
text |
A vector with name of the correspondent title of the url (See 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>
".
A character vector of HTML links for the given urls.
Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/
## 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.