top_articles: Retrieve Data on Top Articles

Description Usage Arguments See Also Examples

View source: R/query.R

Description

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

Usage

1
2
3
4
5
6
7
8
top_articles(
  project = "en.wikipedia",
  platform = "all",
  start = as.Date("2015-10-01"),
  granularity = "daily",
  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 or more of "all", "desktop", "mobile-web" and "mobile-app". Set to "all" by default.

start

The date the articles were "top" in. 2015 by default.

granularity

the granularity of data to return; "daily" or "monthly", depending on whether top articles should reflect trends in day or month of the start date.

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

1
2
3
4
5
# Basic example
enwiki_top_articles <- top_articles()

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

pageviews documentation built on July 8, 2020, 6:17 p.m.