knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

WiGISKeDataViz3

Travis build status AppVeyor build status Codecov test coverage R build status

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
# 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 from Ahmadou Dicko. rgeoboundaries provides easy access in R to data from the GeoBoundaries project.

# 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

ken_preg <-  get_pregnancy_data(csv_file = "https://tinyurl.com/y35htfoj")
head(ken_preg)


afrimapr/WiGISKeDataViz3 documentation built on Aug. 24, 2020, 1:45 p.m.