-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
110 lines (78 loc) · 2.13 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
---
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%"
)
```
# pipload
<!-- badges: start -->
[](https://app.codecov.io/gh/PIP-Technical-Team/pipload?branch=master)
<!-- badges: end -->
The goal of `pipload` is to provide a series of tools to load into memory the PIP microdata. You can load and update the inventory of PIP microdata, as well as find the data most recent version of each country-year-survey data point.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("PIP-Technical-Team/pipload")
```
## Example
Load library
```{r load}
library(pipload)
```
### Microdata
Load Two datasets for Paraguay for the Poverty Calculator tool:
```{r example-md}
# Find the data available.
df <- pip_find_data(
country = "PRY",
year = c(2017, 2018),
tool = "PC"
)
df$filename
# load the data
df2 <- pip_find_data(
country = "PRY",
year = c(2017, 2018),
tool = "PC"
)
names(df2)
```
### load Auxiliary data
Load different types of auxiliary data
```{r example-aux}
# Load CPI
df <- pip_load_aux("cpi")
head(df)
# load PPP
df <- pip_load_aux("ppp")
head(df)
# Load GDP
df <- pip_load_aux("gdp")
head(df)
measure <- "cpi"
# see versions available
df <- pip_load_aux(measure, version = "available")
df
# Load version of "2020-08-07 10:15:48 EDT"
df <- pip_load_aux(measure, version = "20220223154416")
head(df)
# Load one version before current one (i.e., load previous version)
df <- pip_load_aux(measure, version = -1)
head(df)
```
### Inventory of microdata
Check if inventory is up to data and udpate
```{r inventory}
# Update inventory of PRY
# pip_inventory("update", country = "PRY")
# Load inventory
df <- pip_inventory()
df$filename[1:5]
```