--- title: "Accessing Clean UNAIDS Data" output: rmarkdown::html_vignette description: | This vignette addresses how to pull the clean 2020 UNAIDS Estimates from Google Drive to R. vignette: > %\VignetteIndexEntry{accessing-clean-unaids} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = TRUE, echo = TRUE ) options(rmarkdown.html_vignette.check_title = FALSE) ``` ### Introduction This vignette covers how to access the clean and tidy annual UNAIDS Estimates from [GitHub Releases](https://github.com/USAID-OHA-SI/mindthegap/releases). The `mindthegap` package uses a cleaning function (`munge_edms`) (formerly `munge_unaids`) to process, munge, and tidy the UNAIDS HIV Estimates output from the [EDMS database](https://edms.unaids.org/) once new estimates are available annually (around July) and `load_unaids` to load this cleaned data into your session. Let's start by loading the `mindthegap` package. ```{r setup, message = FALSE} library(mindthegap) library(knitr) ``` ### Pull clean data from GitHub Releases When new data are released annually, our team extracts the data from the UNAIDS database and runs `munge_edms` on it to clean and tidy the dataset, including new variables such as a `pepfar` flag to denote whether a country is a PEPFAR country or not and an `estimate_flag` to indicate estimates that are an approximation (previously contained a "\<" or "\>"). In order to make this data accessible outside of R and cut down on the processing time, we uploaded the clean UNAIDS data to the [package releases](https://github.com/USAID-OHA-SI/mindthegap/releases); users can easily access this data by running `load_unaids` with R or directly downloading the data file. To use `load_unaids`, the user just needed to specify whether they want to return all countries or just PEPFAR ones (`pepfar_only = TRUE`), the default. ```{r, message = FALSE} df_unaids <- load_unaids(pepfar_only = TRUE) kable(head(df_unaids), format = "html") ```