Get TB Data in R

CRAN_Release_Badge develVersion Travis-CI Build Status AppVeyor Build Status Coverage Status metacran monthly downloads metacran downloads

Quickly and easily import analysis ready TB burden data, from the World Health Orgnaisation (WHO), into R. The aim of the package is to speed up access to high quality TB burden data, using a simple R interface. Generic plotting functions are provided to allow for rapid graphical exploration of the WHO TB data. A shiny dashboard is built in to showcase package functionality. This package is inspired by a blog post, which looked at WHO TB incidence rates. See here for the WHO data permissions. For help getting started see the Getting Started vignette and for a case study using the package see the Exploring Global Trends in Tuberculosis Incidence Rates vignette.

Installation

Install the CRAN version:

install.packages("getTBinR")

Alternatively install the development version from GitHub:

# install.packages("devtools")
devtools::install_github("seabbs/getTBinR")

Quick start

Lets get started quickly by mapping and then plotting TB incidence rates in the United Kingdom. First map global TB incidence rates in 2016 (this will also download and save both the TB burden data and its data dictionary, if they are not found locally, to R’s temporary directory),

getTBinR::map_tb_burden(metric = "e_inc_100k",
                        year = 2016)
#> Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=estimates
#> Saving data to: /tmp/RtmpVCvtwd/TB_burden.rds
#> Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=mdr_rr_estimates
#> Saving data to: /tmp/RtmpVCvtwd/MDR_TB.rds
#> Joining TB burden data and MDR TB data.
#> Joining, by = c("country", "iso2", "iso3", "iso_numeric", "year")
#> Downloading data from: https://extranet.who.int/tme/generateCSV.asp?ds=dictionary
#> Saving data to: /tmp/RtmpVCvtwd/TB_data_dict.rds
#> 1 results found for your variable search for e_inc_100k
#> Warning: Removed 12 rows containing missing values (geom_path).

Then compare TB incidence rates in the UK to TB incidence rates in other countries in the region,

getTBinR::plot_tb_burden_overview(metric = "e_inc_100k",
                                  countries = "United Kingdom",
                                  compare_to_region = TRUE,
                                  interactive = FALSE)
#> Loading data from: /tmp/RtmpVCvtwd/TB_burden.rds
#> Loading data from: /tmp/RtmpVCvtwd/MDR_TB.rds
#> Joining TB burden data and MDR TB data.
#> Joining, by = c("country", "iso2", "iso3", "iso_numeric", "year")
#> Loading data from: /tmp/RtmpVCvtwd/TB_data_dict.rds
#> 1 results found for your variable search for e_inc_100k