forked from ropensci/nomisr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
115 lines (78 loc) · 5.54 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# nomisr
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/nomisr)](https://cran.r-project.org/package=nomisr)
[![GitHub tag](https://img.shields.io/github/tag/ropensci/nomisr.svg)](https://github.com/ropensci/nomisr)
[![](https://cranlogs.r-pkg.org/badges/grand-total/nomisr)](https://dgrtwo.shinyapps.io/cranview/)
[![Travis-CI Build Status](https://travis-ci.org/ropensci/nomisr.svg?branch=master)](https://travis-ci.org/ropensci/nomisr)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/evanodell/nomisr?branch=master&svg=true)](https://ci.appveyor.com/project/evanodell/nomisr)
[![Coverage Status](https://img.shields.io/codecov/c/github/ropensci/nomisr/master.svg)](https://codecov.io/github/ropensci/nomisr?branch=master)
[![ropensci](https://badges.ropensci.org/190_status.svg)](https://github.com/ropensci/onboarding/issues/190)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1246845.svg)](https://doi.org/10.5281/zenodo.1246845)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.00859/status.svg)](https://doi.org/10.21105/joss.00859)
`nomisr` is for accessing UK official statistics from the [Nomis](https://www.nomisweb.co.uk/) database through R. Nomis contains data from the Census, the Labour Force Survey, DWP benefit statistics and other economic and demographic data, and is maintained on behalf of the Office for National Statistics by the University of Durham.
The `nomisr` package provides functions to find what data is available, the variables and query options for different datasets and a function for downloading data. `nomisr` returns data in [`tibble`](https://cran.r-project.org/package=tibble) format. Most of the data available through `nomisr` is based around statistical geographies, with a handful of exceptions.
The package is for demographers, economists, geographers, public health researchers and any other researchers who are interested in geographic factors. The package aims to aid reproducibility, reduce the need to manually download area profiles, and allow easy linking of different datasets covering the same geographic area.
## Installation
`nomisr` is available on CRAN:
```{r cran-installation, eval = FALSE}
install.packages("nomisr")
```
You can install the development version `nomisr` from github with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("ropensci/nomisr")
```
## Using `nomisr`
`nomisr` contains functions to search for datasets, identify the query options for different datasets and retrieve data from queries, all done with [`tibbles`](https://tibble.tidyverse.org/), to take advantage of how `tibble` manages list-columns. The use of metadata queries, rather than simply downloading all available data, is useful to avoid overwhelming the rate limits of the API. For full details on all available functions and demonstrations of their use, please see the package [vignette](https://docs.evanodell.com/nomisr/articles/introduction.html).
The example below gets the latest data on Jobseeker's Allowance with rates and proportions, on a national level, with all male claimants and workforce.
```{r example}
library(nomisr)
jobseekers_search <- nomis_search(name = "*Jobseeker*")
tibble::glimpse(jobseekers_search)
jobseekers_measures <- nomis_get_metadata("NM_1_1", "measures")
tibble::glimpse(jobseekers_measures)
jobseekers_geography <- nomis_get_metadata("NM_1_1", "geography", "TYPE")
tail(jobseekers_geography)
jobseekers_sex <- nomis_get_metadata("NM_1_1", "sex", "TYPE")
tibble::glimpse(jobseekers_sex)
z <- nomis_get_data(id = "NM_1_1", time = "latest", geography = "TYPE499",
measures=c(20100, 20201), sex=5)
tibble::glimpse(z)
```
There is a lot of data available through Nomis, and there are some limits to the amount of data that can be retrieved within a certain period of time, although those are not published. For more details, see the [full API documentation](https://www.nomisweb.co.uk/api/v01/help) from Nomis. Full package documentation is available at [docs.evanodell.com/nomisr](https://docs.evanodell.com/nomisr)
## Meta
Bug reports, suggestions, and code contributions are all welcome. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.
Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.
Please note that this project is not affiliated with the Office for National Statistics or the University of Durham.
Get citation information for `nomisr` in R with `citation(package = 'nomisr')`
Odell, (2018). nomisr: Access 'Nomis' UK Labour Market Data. Journal of Open Source Software, 3(27), 859, https://doi.org/10.21105/joss.00859.
A BibTeX entry for LaTeX users is
```
@article{odell2018,
title = {Nomisr: {{Access Nomis UK Labour Market Data}}},
volume = {3},
issn = {2475-9066},
url = {https://github.com/ropensci/nomisr},
doi = {10.21105/joss.00859},
number = {27},
journaltitle = {Journal of Open Source Software},
urldate = {2018-08-01},
note = {R package version 0.4.0}
date = {2018-07-28},
pages = {859},
author = {Odell, Evan}
}
```
License: [MIT](LICENSE.md)
[![ropensci_footer](https://ropensci.org/public_images/ropensci_footer.png)](https://ropensci.org)