Description Usage Arguments Value See Also Examples
View source: R/plot_tb_burden_overview.R
This functions returns a dot plot for a given metric over a specified
list of countries. If compare_to_region
is specified then a given country will
be compared to others in its region. This enables the user to rapidly understand trends in
Tuberculosis over time and the progress towards global elimination.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | plot_tb_burden_overview(
df = NULL,
dict = NULL,
metric = "e_inc_100k",
metric_label = NULL,
countries = NULL,
years = NULL,
compare_to_region = FALSE,
facet = NULL,
annual_change = FALSE,
trans = "identity",
legend = "bottom",
scales = "free_y",
interactive = FALSE,
download_data = TRUE,
save = TRUE,
viridis_palette = "viridis",
viridis_direction = -1,
viridis_end = 0.9,
verbose = FALSE,
...
)
|
df |
Dataframe of TB burden data, as sourced by |
dict |
A tibble of the data dictionary. See |
metric |
Character string specifying the metric to plot |
metric_label |
Character string specifying the metric label to use. |
countries |
A character string specifying the countries to target. |
years |
Numeric vector of years. Defaults to |
compare_to_region |
Logical, defaults to |
facet |
Character string, the name of the variable to facet by. |
annual_change |
Logical, defaults to |
trans |
A character string specifying the transform to use on the specified metric. Defaults to no
transform ("identity"). Other options include log scaling ("log") and log base 10 scaling
("log10"). For a complete list of options see |
legend |
Character string, defaults to |
scales |
Character string, see ?ggplot2::facet_wrap for details. Defaults to "fixed", alternatives are "free_y", "free_x", or "free". |
interactive |
Logical, defaults to |
download_data |
Logical, defaults to |
save |
Logical, should the data be saved for reuse during the current R session. Defaults to
|
viridis_palette |
Character string indicating the |
viridis_direction |
Numeric, indicating the direction for the colour palette (1 or -1), defaults to -1.
See |
viridis_end |
Numeric between 0 and 1, defaults to 0.9. The end point of the viridis scale to use.
#' See |
verbose |
Logical, defaults to |
... |
Additional arguments to pass to |
A dot plot of any numeric metric by country.
get_tb_burden search_data_dict
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Plot incidence rates over time for both the United Kingdom and Botswana
plot_tb_burden_overview(
countries = c("United Kingdom", "Botswana"),
compare_to_region = FALSE
)
## Plot percentage annual change in incidence rates.
plot_tb_burden_overview(
countries = c("United Kingdom", "Botswana"),
compare_to_region = FALSE, annual_change = TRUE
)
## Compare incidence rates in the UK and Botswana to incidence rates in their regions
plot_tb_burden_overview(
countries = c("United Kingdom", "Botswana"),
compare_to_region = TRUE
)
## Find variables relating to mortality in the WHO dataset
search_data_dict(def = "mortality")
## Compare mortality rates (exc HIV) in the UK and Botswana to mortality rates in their regions
## Do not show progress messages
plot_tb_burden_overview(
metric = "e_mort_exc_tbhiv_100k",
countries = c("United Kingdom", "Botswana"),
compare_to_region = TRUE, verbose = FALSE
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.