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 = TRUE, ...)
df | Dataframe of TB burden data, as sourced by |
---|---|
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 |
download_data | Logical, defaults to |
save | Logical, should the data be saved for reuse during the current R session. Defaults to
|
verbose | Logical, defaults to |
... | Additional arguments to pass to |
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.
## 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%#>#>#>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%