Introduction
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.
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; 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")
year | iso | country | pepfar | region | indicator | indicator_type | age | sex | estimate | lower_bound | upper_bound | estimate_flag | achv_95_plhiv | achv_95_relative | achv_epi_control |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1990 | AGO | Angola | TRUE | Eastern and southern Africa | Prevalence | Rate | 15-49 | All | 0.8 | 0.5 | 1.0 | NA | NA | NA | NA |
1990 | AGO | Angola | TRUE | Eastern and southern Africa | Prevalence | Rate | 15-24 | Female | 0.7 | 0.3 | 1.2 | NA | NA | NA | NA |
1990 | AGO | Angola | TRUE | Eastern and southern Africa | Prevalence | Rate | 15-24 | Male | 0.3 | 0.1 | 0.5 | NA | NA | NA | NA |
1990 | AGO | Angola | TRUE | Eastern and southern Africa | Number AIDS Related Deaths | Integer | All | All | 2800.0 | 1600.0 | 3800.0 | NA | FALSE | FALSE | NA |
1990 | AGO | Angola | TRUE | Eastern and southern Africa | Number AIDS Related Deaths | Integer | 0-14 | All | 1200.0 | 700.0 | 1500.0 | NA | FALSE | FALSE | NA |
1990 | AGO | Angola | TRUE | Eastern and southern Africa | Number AIDS Related Deaths | Integer | 15+ | All | 1600.0 | 910.0 | 2300.0 | NA | FALSE | FALSE | NA |