Giter Site home page Giter Site logo

statsgrokse's Introduction

R API Binding to Stats.grok.se Server

Status

codecov

lines of R code: 316, lines of test code: 199

Development version

0.1.3 - 2017-03-22 / 21:09:01

Description

The 'http://stats.grok.se' server provides data and an 'API' for Wikipedia page view statistics from 2008 up to 2015. This package provides R bindings to the 'API'.

License

GPL (>= 2)
Peter Meissner [aut, cre], R Core Team [ctb]

Citation

citation("statsgrokse")

BibTex for citing

toBibtex(citation("statsgrokse"))

Installation

Stable version from CRAN:

install.packages("statsgrokse")

Latest development version from Github:

devtools::install_github("petermeissner/statsgrokse")

Usage

getting data

The workhorse of the package is the wp_trend() function:

library(statsgrokse)

pageviews <-   
  statsgrokse(
    page = "Edward_Snowden", 
    from = "2013-06-01", 
    to   = "2013-07-31", 
    lang = c("en","de")
  )
## http://stats.grok.se/json/en/201306/Edward_Snowden
## http://stats.grok.se/json/en/201307/Edward_Snowden
## http://stats.grok.se/json/de/201306/Edward_Snowden
## http://stats.grok.se/json/de/201307/Edward_Snowden

plotting data

pageviews <- pageviews[order(pageviews$lang, pageviews$date), ]

par(mfrow=c(1,2), oma = c(0, 0, 1, 0))

with(
  pageviews,
  {
    plot(date[lang=="en"], count[lang=="en"], type="l", xlab = "date", col="#183691")
    plot(date[lang=="de"], count[lang=="de"], type="l", xlab = "date", col="#183691")
  }
)
mtext("API Pageviews", line=-2, outer = TRUE, cex = 1.5)

par(mfrow=c(1,1), oma=c(0,0,0,0))

statsgrokse's People

Contributors

petermeissner avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

statsgrokse's Issues

First Round ToDos

  • strip down package to bare api bindings
  • throw away wikipediatrend documentation
  • rename functions
  • restructure download procedure into wrapper, url_generator, and downloader
  • decide whether or not to put caching into statsgrokse or wikipediatrend --> NO

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.