-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
82 lines (63 loc) · 2.31 KB
/
README.Rmd
File metadata and controls
82 lines (63 loc) · 2.31 KB
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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# pipapi
<!-- badges: start -->
<!-- [](https://codecov.io/gh/PIP-Technical-Team/pipapi?branch=master) -->
[](https://github.com/PIP-Technical-Team/pipapi/actions?workflow=R-CMD-check)
[](https://github.com/PIP-Technical-Team/pipapi/actions)
[](https://github.com/PIP-Technical-Team/pipapi/actions)
<!-- badges: end -->
The goal of pipapi is to provide a high level API to the computations and
methods that power the Poverty and Inequality Platform (PIP).
World Bank staff who have read access to the PIP data can use the functions from
this package directly, without hitting the PIP API.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("PIP-Technical-Team/pipapi")
```
## Getting started
The main function from the `pipapi` package is the `pip()` function. See `?pip`
for more information.
### Data access
In order to use `pip()` you'll need to have access to a PIP `data_folder`.
The folder structure looks like this:
```{bash eval=FALSE, echo=TRUE}
data-folder-root/
├─ _aux/
│ ├─ pop_regions.fst
│ ├─ pop.fst
│ ├─ ...
├─ estimations/
│ ├─ prod_svy_estimation.fst
│ ├─ prod_ref_estimation.fst
├─ survey_data/
│ ├─ survey_1.fst
│ ├─ ...
│ ├─ survey_n.fst
```
```{r data-access, eval=FALSE, echo=TRUE}
# Create a list of look-up tables from the root data folder
lkups <- create_lkups("<data-folder>")
```
### Usage
Pass the `lkups` list to the main `pip()` function to compute poverty and inequality
statistics in your `R` session.
```{r pip}
library(pipapi)
pip(country = "AGO",
year = 2000,
povline = 1.9,
lkup = lkups)
```