Learn R Programming

pageviews (version 0.1.0)

top_articles: Retrieve Data on Top Articles

Description

top_articles grabs data on the top articles for a project in a given time period, and for a particular platform.

Usage

top_articles(project = "en.wikipedia", platform = "all", year = "2015",
  month = "10", day = "01", reformat = TRUE, ...)

Arguments

project
the name of the project, structured as [language_code].[project] (see the default).
platform
The platform the pageviews came from; one of "all", "desktop", "mobile-web" and "mobile-app". Set to "all" by default.
year
The year the articles were "top" in. 2015 by default.
month
The month the articles were "top" in. "10" by default; can be set to "all", for all the months in year. If so, day must also be "all".
day
The day the articles were "top" in. "01" by default; can be set to "all", for all the days in month.
reformat
Whether to reformat the results as a data.frame or not. TRUE by default.
...
further arguments to pass to httr's GET.

See Also

article_pageviews for per-article pageviews and project_pageviews for per-project pageviews.

Examples

Run this code
# Basic example
enwiki_top_articles <- top_articles()

# Use a narrower platform
enwiki_mobile_top <- top_articles(platform = "mobile-web")

Run the code above in your browser using DataLab