Learn R Programming

WikipediaR (version 1.1)

userInfo: provides general information about a Wikipedia user

Description

provides general information about a specific Wikipedia user

Usage

userInfo(user.name = NULL, domain = "en", usprop = "groups|implicitgroups|rights|editcount|registration|emailable|gender")

Arguments

user.name
a character value for the name of a user
domain
a character value providing the language of the wikipedia page.The default value is "en" for "english language".
usprop
What pieces of information to include (separate with '|'):
  • groups: lists all the groups the user(s) belongs to
  • implicitgroups: lists all the groups a user is automatically a member of
  • rights: lists all the rights the user(s) has
  • editcount: adds the user's edit count
  • registration: adds the user's registration timestamp
  • emailable: tags if the user can and wants to receive email through [[Special:Emailuser]]
  • gender: tags the gender of the user. Returns "male", "female", or "unknown"

Default: groups|implicitgroups|rights|editcount|registration|emailable|gender

Value

an object of class userInfoClass containing:
  • call the command line
  • rights only if asked: a vector of rights. If not asked, this item does not exist.
  • groups only if asked: a vector of groups names. If not asked, this item does not exist.
  • implicitgroups only if asked: a vector of implicit groups names. If not asked, this item does not exist.
  • info a data frame containing the other asked properties of user (at least userid and name).
  • testWikiUser A list of three elements. The first is takeOnlyFirst, a boolean indicating if the class of user.name parameter is invalid, for example vector, list, matrix..., and in that case, the only the first element is considered. The second element is test, an integer with value:
    • 4 for invalid domain,
    • 3 for an empty parameter user,
    • 2 when Wikipedia does not have an user with this exact name,
    • 0 for valid existing user.
    The last element, warnMessage, is a vector of warning messages.

Details

This function uses the MediaWiki API query syntax: "list=users". For more details, see https://www.mediawiki.org/wiki/API:Users

Examples

Run this code
## Not run: 
# LouiseInfo <- userContribs(user.name = "Louise", domain = "en")
# LouiseInfo
# bobInfo <- userInfo(user.name = "bob", domain = "en")
# bobInfo
# ## try a user that does not exist (at the moment of the redaction of this help page)
# userInfo(user.name="Louise Baschet", domain ="fr")
# ## End(Not run)

Run the code above in your browser using DataLab