Last data update: 2014.03.03

R: Function for getting access statistics for wikipedia pages
wp_trendR Documentation

Function for getting access statistics for wikipedia pages

Description

Function for getting access statistics for wikipedia pages

Usage

wp_trend(page, from = prev_month_start(), to = prev_month_end(),
  lang = "en", file = "")

Arguments

page

The name of the Wikipedia page as to be found in the URL to the wikipedia article. If e.g. the URL is: https://en.wikipedia.org/wiki/Peter_Fox_(musician), than the page name equals to Peter_Fox_(musician).

from

The starting date of the timespan for which access statistics should be retrieved - note that there is no data prior to 2007-12-01. Supply some sort of timestamp e.g. of class POSIXlt, POSIXct, Date, or character. If the option is of type character it should be in the form of yyyy-mm-dd.

to

The last date for which access statistics should be retrieved. Supply some sort of timestamp e.g. of class POSIXlt, POSIXct, Date, or character. If the option is of type character it should be in the form of yyyy-mm-dd.

lang

The language shorthand identifying which Wikipedia access statistics are to be used: e.g. "en" for the English version found at https://en.wikipedia.org, "de" for the German version found at https://de.wikipedia.org or perhaps "als" for the Alemannic dialect found under https://als.wikipedia.org/.

file

Where to store data retrieved by function call? The data is stored in CSV format. If an already existing file is used for storage, the old data will not be deleted but instead new data will be added to this file! The cache in memory before the function call will be saved and restored afterwards. If you prefer automatic mirroring of in memory cache and cache on disk

Examples

library(wikipediatrend)
wp_trend(  page        = c("Cheese", "Ku00e4se"),
           from        = "2014-11-01", 
           to          = "2014-11-30", 
           lang        = c("en", "de"),
           file        = wp_cache_file()
         )


Results