knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = TRUE, echo = TRUE ) options(rmarkdown.html_vignette.check_title = FALSE)
This vignette covers how to access the clean and tidy annual UNAIDS Estimates from GitHub 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 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.
library(mindthegap) library(knitr)
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; 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.
df_unaids <- load_unaids(pepfar_only = TRUE) kable(head(df_unaids), format = "html")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.