Coder Social home page Coder Social logo

dwpstat's Introduction

dwpstat

License: MIT DOI Travis build status lifecycle

This package provides access to the ‘Stat-Xplore Open Data API’, containing welfare statistics from the UK Department for Work and Pensions.

The ‘Stat-Xplore Open Data API’ is a JSON REST API, with the same data as on the Stat-Xplore online service. All queries require the use of an API key. To set up an API key, use dwp_api_key(). The API is free to use, but queries are rate limited. To find the number of allowable queries per hour, and the number of queries remaining, use dwp_rate_limit().

Full documentation of the API is available (here)[https://stat-xplore.dwp.gov.uk/webapi/online-help/Open-Data-API.html].

dwpstat returns metadata in (tibble)[https://cran.r-project.org/package=tibble] format, and data in a list format. The list format is very messy, thanks to the way the API is built, and so dwpstat does not convert this data into a (tibble)[https://cran.r-project.org/package=tibble] or similar.

Installation

You can install the development version of dwpstat from GitHub with:

# install.packages("devtools")
devtools::install_github("evanodell/dwpstat")

Use

library(dwpstat)
x <- dwp_get_data(database = "str:database:ESA_Caseload",
                   measures = "str:count:ESA_Caseload:V_F_ESA",
                   column = c("str:field:ESA_Caseload:V_F_ESA:CCSEX",
                              "str:field:ESA_Caseload:V_F_ESA:CTDURTN"),
                   row = "str:field:ESA_Caseload:V_F_ESA:ICDGP",
                   wafer = "str:field:ESA_Caseload:V_F_ESA:IB_MIG")

class(x)
[1] "list"

names(x)
[1] "query"         "database"      "measures"      "fields"        "cubes"         "annotationMap"

Meta

Bug reports, feature requests and pull requests are all welcome.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

This project is not affiliated with or endorsed by the Department for Work and Pensions.

Get citation information for dwpstat in R with citation(package = 'dwpstat')

Odell E (2018). dwpstat: Access ‘Stat-Xplore’ data on the UK benefits system. doi: 10.5281/zenodo.1421684 (URL: http://doi.org/10.5281/zenodo.1421684), R package version 0.0.0.9000, <URL: https://github.com/evanodell/dwpstats>.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {{dwpstat}: Access 'Stat-Xplore' data on the UK benefits system},
    author = {Evan Odell},
    year = {2018},
    note = {R package version 0.0.0.9000},
    doi = {10.5281/zenodo.1421684},
    url = {https://github.com/evanodell/dwpstats},
  }

License: MIT

dwpstat's People

Contributors

evanodell avatar

Watchers

James Cloos avatar Joe Heywood avatar

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.