links(page = NULL, domain = "en")
linksClass
containing:
call
the command line
page
title, identification number, and domain of the Wikipedia page
links
a data frame containing title
, the titles of the linked pages,
ns
, numbers of the namespaces (identification of the type of pages, defining nscat et nssubj, the two next variables),
nscat
, the categories of linked pages (Subject, Talk, or Virtual),
nssubj
, the subjects of the linked pages (Main Article, User, Wikipedia, File, MediaWiki, Template, Help, Category, Protal, Book, Draft, Education Program, TimedText, Module, Topic, Special, Media, Other).
For more details about namespace, see http://www.mediawiki.org/wiki/Help:Namespaces and http://en.wikipedia.org/wiki/Wikipedia:Namespace#Subject_namespacesextlinks
a vector containing the list of url of external links. If there is no external link in the page, this item is not created.
testWikiPage
a list of four elements,
takeOnlyFirst
a boolean indicating if the class of page
parameter is invalid,
for example vector, list, matrix..., and in that case, only the first element is considered.
redirPage
title of the redirected url. This item is NULL if the page is not redirected.
test
an integer with value:
warnMessage
is a vector of warning messages.
## Not run:
# # a simple example
# links("Louis Pasteur") # default domain : en
#
# # with a redirected page
# links.Obama <- links(page ="Obama")
# links.Obama
# # warning message
#
# # a simple example with page specified by its page ID number
# links(page = 976, domain = "fr" )
#
# # with a page that not exist (at the moment of the redaction of this help page)
# links("zzzzz")
# ## End(Not run)
Run the code above in your browser using DataLab