-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
70 lines (47 loc) · 2.83 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
---
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%"
)
```
# WiGISKeDataViz3
<!-- badges: start -->
[](https://travis-ci.org/anelda/WiGISKeDataViz3)
[](https://ci.appveyor.com/project/anelda/WiGISKeDataViz3)
[](https://codecov.io/gh/anelda/WiGISKeDataViz3?branch=master)
[](https://github.com/afrimapr/WiGISKeDataViz3/actions)
<!-- badges: end -->
The goal of WiGISKeDataViz3 is to facilitate easy access to datasets, analysis and visualisation used in the Women in GIS Kenya data viz challenge #3 where the focus was on teenage pregnancies between 2016 - 2020. For more information about the challenge see https://wigis.co.ke/project/visualizing-teenage-pregnancy-and-related-factors/.
## Installation
WiGISKeDataViz3 is not on CRAN but you can install the development version available on Github as follows:
``` {r warning = FALSE, message = FALSE}
# install.packages("devtools") # if not already installed
# devtools::install_github("afrimapr/WiGISKeDataViz3")
library(WiGISKeDataViz3)
```
## Example
### Population data to use in normalisation
Access population data from the World Bank Data Bank to normalise pregnancy data. The World Pop datasets that will work (given the dataformat and cleanup code) include "SP.POP.1014.FE", "SP.POP.1014.MA", "SP.POP.1519.FE", "SP.POP.1519.MA".
```{r example population}
# Create tibble with population data for females age
ken_fem_1014 <- get_wb_gender_age_pop_data(country_iso = "KEN", indicator_code = "SP.POP.1014.FE", start = 2016, end = 2019, new_date = 2020)
head(ken_fem_1014)
```
### Admin boundaries to use in maps and analysis
Access administrative boundaries for Kenya through the [rgeoboundaries package](https://github.com/dickoa/rgeoboundaries) from [Ahmadou Dicko](https://twitter.com/dickoah). rgeoboundaries provides easy access in R to data from the [GeoBoundaries project](https://www.geoboundaries.org/).
```{r example boundaries}
# Create sf object for Kenya admin level 2 (sub-county) with cleaned-up sub-county names
ken_adm2 <- get_admin_geoboundaries(country_name = "kenya", boundary_type = "sscgs", admin_level = "adm2")
str(ken_adm2)
```
### Pregnancy data
```{r example pregancy, warning=FALSE, message=FALSE}
ken_preg <- get_pregnancy_data(csv_file = "https://tinyurl.com/y35htfoj")
head(ken_preg)
```