This function provides a curated list of summary measures for a given TB metric in countries of interest. It can been used to facilitate reporting and is used extensively in the TB report included in the package (see render_country_report). It outputs the most recent year of data in the target country for a given metric, along with the year this data was recorded, the regional and global rank and the average change in the last decade. For a more customisable metric summary see summarise_tb_burden as a starting point.

summarise_metric(
  df = NULL,
  metric = NULL,
  countries = NULL,
  conf = c("_lo", "_hi"),
  download_data = TRUE,
  save = TRUE,
  verbose = FALSE,
  ...
)

Arguments

df

Dataframe of TB burden data, as sourced by get_tb_burden. If not specified then will source the WHO TB burden data, either locally if available or directly from the WHO (if download_data = TRUE).

metric

Character string specifying the metric to plot

countries

A character string specifying the countries to target.

conf

Character vector specifying the name variations to use to specify the upper and lower confidence intervals. Defaults to c("_lo", "_hi"), if set to NULL then no confidence intervals are shown.

download_data

Logical, defaults to TRUE. If not found locally should the data be downloaded from the specified URL?

save

Logical, should the data be saved for reuse during the current R session. Defaults to TRUE. If TRUE then the data is saved to the temporary directory specified by tempdir.

verbose

Logical, defaults to FALSE. Should additional status and progress messages be displayed.

...

Additional arguments to pass to get_tb_burden.

Value

A tibble containing the name of the target country, the year of the most recent data available, the most recent value for the metric, the regional rank, the global rank and the average change in the previous decade.

Examples

## Get a summary of TB incidence rates for the united kingdom and germany summarise_metric(metric = "e_inc_100k", countries = c("United Kingdom", "Germany"))
#> # A tibble: 2 x 6 #> country year metric world_rank region_rank avg_change #> <chr> <int> <chr> <int> <int> <chr> #> 1 United Kingdom 2018 8 (7.2 - 8.8) 165 33 -5.9% #> 2 Germany 2018 7.3 (6.2 - 8.4) 166 34 2.6%
## Get a summary of case detection rates in France summarise_metric(metric = "c_cdr", countries = "France")
#> # A tibble: 1 x 6 #> country year metric world_rank region_rank avg_change #> <chr> <int> <chr> <int> <int> <chr> #> 1 France 2018 83 (73 - 94) 93 37 0%
## Get a summary of case detection rates in France - without confidence intervals summarise_metric(metric = "c_cdr", countries = "France", conf = NULL)
#> # A tibble: 1 x 6 #> country year metric world_rank region_rank avg_change #> <chr> <int> <dbl> <int> <int> <chr> #> 1 France 2018 83 93 37 0%
## Provide a dataset and get summary measures from it. tb <- get_tb_burden() summarise_metric(df = tb, metric = "c_cdr", countries = "France")
#> # A tibble: 1 x 6 #> country year metric world_rank region_rank avg_change #> <chr> <int> <chr> <int> <int> <chr> #> 1 France 2018 83 (73 - 94) 93 37 0%