-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
48 lines (33 loc) · 1.8 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
---
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%"
)
```
# pcodesOCHA
<!-- badges: start -->
<!-- badges: end -->
The goal of pcodesOCHA is to scrap pcodes and geoJSON from [UNOCHA Common Operational Datasets web server](https://gistmaps.itos.uga.edu/arcgis/rest/services)
While the package can be used as a standalone, the scraped files are available in output folder.
A Cron job runs once a month at 12:00 am to update the outputs thanks to github actions.
# Functions available
- all_pcodes : list all pcodes availables
- all_pcodes_feature_servers : legacy all_pcodes
- available_countries : list all available countries and their corresponding [ISO 3 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3)
- country_geojson_URL : scrape geoJSON for a country from URL
- country_geojson_iso3 : scrape geoJSON for a country from ISO 3 code
- country_pcodes_URL : scrape pcodes for a country from URL
- country_pcodes_iso3 : scrape pcodes for a country from ISO 3 code
- one_URL_geoJSON : scrape geoJSON from a specific URL for the API
- one_URL_properties : scrape properties (pcodes) from a specific URL for the API
# Datasets available
the easiest way to use the data is probably by importing directly the data from the raw data in the folder output:
- CSV : https://raw.githubusercontent.com/ElliottMess/pcodesOCHA/master/output/all_pcodes_20210112.csv
- JSON : https://raw.githubusercontent.com/ElliottMess/pcodesOCHA/master/output/all_pcodes_20210112.json
For instance to read it with readr: pcodes <- readr::read_csv("https://raw.githubusercontent.com/ElliottMess/pcodesOCHA/master/output/all_pcodes_20210112.csv")