wikipedia_pageviews | R Documentation |
Download Wikipedia daily page views for any language, using the Wikimedia REST API.
wikipedia_pageviews(
articles,
date_range = last_6_months(),
language = "nl",
platform = c("all-access", "mobile-web", "mobile-app", "desktop"),
agent = c("all-agents", "user", "spider", "automated")
)
articles |
Wikipedia article title(s) |
date_range |
defaults to |
language |
defaults to |
platform |
defaults to |
agent |
defaults to |
Zie voor een voorbeeld: https://pageviews.wmcloud.org/?project=nl.wikipedia.org&platform=all-access&agent=all-agents&redirects=0&start=2024-06-01&end=2025-02-01&pages=Griep|Influenzavirus_A
wikipedia_pageviews("Griep")
articles <- c("Griep", "Koorts", "Hoest", "Verkoudheid", "Influenzavirus A",
"Respiratoir syncytieel virus", "Keelpijn", "SARS-CoV-2")
if (require("certeplot2") && require("certestats") && require("dplyr")) {
articles |>
wikipedia_pageviews(c("2024-07-01", "2025-02-01")) |>
group_by(article) |>
mutate(z = z_score(views),
z_ma = moving_average(z, w = 7, side = "left")) |>
plot2(
x = date,
y = z_ma,
category = article,
type = "line",
category.sort = "freq-asc",
legend.position = "right",
y.title = "7-daagse Z-score",
x.title = "",
title = "Wikipedia bezochte pagina's",
subtitle = "Z-scores respiratoire seizoen")
}
if (require("certeplot2")) {
wikipedia_pageviews("Dog",
language = "en",
date_range = last_5_years()) |>
plot2(x = date, y = views)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.