Public Subject Attention via Wikipedia Page View Statistics
Status
lines of R code: 470, lines of test code: 160
Version
2.1.4 ( 2019-09-21 15:25:37 )
Description
License
GPL (>= 2)
Peter Meissner [aut, cre], R Core Team [cph]
Credits
- Parts of the package’s code have been shamelessly copied and
modified from R base package written by R core team. This concerns
the
wp_date()
generic and its methods and is detailed in the help files.
Citation
citation("wikipediatrend")
Meissner P (2019). wikipediatrend: Public Subject Attention via Wikipedia Page View Statistics. R package version 2.1.4.
BibTex for citing
toBibtex(citation("wikipediatrend"))
Installation
Stable version from CRAN:
install.packages("wikipediatrend")
Latest development version from Github:
devtools::install_github("petermeissner/wikipediatrend")
Usage
starting up …
library(wikipediatrend)
##
## [wikipediatrend]
##
## Note:
##
## - Data before 2016-01-01
## * is provided by petermeissner.de and
## * was prepared in a project commissioned by the Hertie School of Governance (Prof. Dr. Simon Munzert)
## * and supported by the Daimler and Benz Foundation.
##
## - Data from 2016-01-01 onwards
## * is provided by the Wikipedia Foundation
## * via its pageviews package and API.
##
getting some data …
trend_data <-
wp_trend(
page = c("Der_Spiegel", "Die_Zeit"),
lang = c("de", "en"),
from = "2007-01-01",
to = Sys.Date()
)
having a look …
trend_data
## language article date views
## 2 en die_zeit 2007-12-10 74
## 1 de der_spiegel 2007-12-10 798
## 4 en die_zeit 2007-12-11 35
## 3 de der_spiegel 2007-12-11 710
## 5 de der_spiegel 2007-12-12 770
## 8602 en die_zeit 2019-09-18 182
## 8604 en die_zeit 2019-09-19 157
## 8603 de der_spiegel 2019-09-19 1125
## 8606 en die_zeit 2019-09-20 165
## 8605 de der_spiegel 2019-09-20 943
##
## ... 8596 rows of data not shown
having another look …
plot(
trend_data[trend_data$views < 2500, ]
)