Package 'vimcheck'

Title: Diagnostics for Vaccine Impact Modelling Consortium Burden and Impact Estimates
Description: Run diagnostics on burden estimates submitted by modellers in the Vaccine Impact Modelling Consortium (VIMC) and impact estimates calculated by the VIMC Science & Policy team.
Authors: Pratik Gupte [aut, cre] (ORCID: <https://orcid.org/0000-0001-5294-7819>), Katy Gaythorpe [aut] (ORCID: <https://orcid.org/0000-0003-3734-9081>), Xiang Li [aut] (ORCID: <https://orcid.org/0000-0002-5945-159X>), Zoë Gibney [aut] (ORCID: <https://orcid.org/0009-0002-8114-9984>), Imperial College of Science, Technology and Medicine [cph, fnd]
Maintainer: Pratik Gupte <[email protected]>
License: MIT + file LICENSE
Version: 0.0.5
Built: 2026-07-21 12:41:41 UTC
Source: https://github.com/vimc/vimcheck

Help Index


vimcheck: Diagnostics for Vaccine Impact Modelling Consortium Burden and Impact Estimates

Description

Run diagnostics on burden estimates submitted by modellers in the Vaccine Impact Modelling Consortium (VIMC) and impact estimates calculated by the VIMC Science & Policy team.

Author(s)

Maintainer: Pratik Gupte [email protected] (ORCID)

Authors:

Other contributors:

  • Imperial College of Science, Technology and Medicine [copyright holder, funder]

See Also

Useful links:


Sanity checks on burden estimates

Description

Helper function for sanity checks on burden estimate values. Checks whether any burden estimates are non-numeric, missing, or negative.

Usage

basic_burden_sanity(burden)

Arguments

burden

A ⁠<data.frame>⁠ of disease burden estimates. Must have at least a single column named "value" of numeric burden estimates.

Value

A character vector of messages generated by checks on burden estimates, with the length of the vector depending on how many checks fail.


Check incoming burden cohort size against interpolated population

Description

Check the modelled disease burden data has similar population sizes as the provided population data.

Usage

check_demography_alignment(
  burden_set,
  wpp,
  gender = c("Both", "Male", "Female")
)

Arguments

burden_set

A ⁠<data.frame>⁠ of modeller-provided burden-set data.

wpp

Population estimates for the country in burden_set, provided by VIMC.

gender

The assigned sex for which demography is to be checked. Options are "Both" (default), "Male", or "Female".

Value

A ⁠<tibble>⁠ giving the alignment, i.e., percentage difference of modelled population size from the WPP-derived population estimates.


Compare sub-regional and national estimates

Description

Compare sub-regional and national estimates

Usage

compare_natl_subreg(
  df,
  outcome = c("deaths_averted_rate", "dalys_averted_rate"),
  activity_filter = c("campaign", "routine")
)

Arguments

df

A data.frame with sub-region level data on vaccination impact outcomes.

outcome

A string for the outcome of interest. May be one of "deaths_averted_rate" or "dalys_averted_rate".

activity_filter

A string for the type of vaccination activity. May be one of "campaign" or "routine".

Value

A data.frame of sub-regional vaccination impact estimates where the impact is considered to be outside the tolerance limit.


Package constants

Description

Constant values used in vimcheck. See the Examples section for the constant values.

Usage

file_dict_colnames

scenario_data_colnames

burden_outcome_names

colnames_plot_demog_compare

colnames_df_missing_cols

COLNAMES_KEY_PRESSURE_TEST

COLNAMES_INTEREST_PRESSURE_TEST

IMPACT_OUTCOMES

EXCLUDED_DISEASES

N_TS_MIN_CHARS

N_TS_YEAR_CHARS

MIN_TS_YEAR

MAX_TS_YEAR

MIN_TS_MONTH

MAX_TS_MONTH

DEF_TOUCHSTONE_OLD

DEF_TOUCHSTONE_NEW

DEF_TOUCHSTONE_OLD_OLD

COLOUR_VIMC

PINE

Format

An object of class character of length 5.

An object of class character of length 4.

An object of class character of length 10.

An object of class character of length 7.

An object of class character of length 5.

An object of class character of length 7.

An object of class character of length 14.

An object of class character of length 2.

An object of class character of length 4.

An object of class integer of length 1.

An object of class integer of length 1.

An object of class numeric of length 1.

An object of class numeric of length 1.

An object of class numeric of length 1.

An object of class numeric of length 1.

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 1.

An object of class character of length 4.

Examples

file_dict_colnames

scenario_data_colnames

burden_outcome_names

colnames_plot_demog_compare

colnames_df_missing_cols

COLNAMES_KEY_PRESSURE_TEST

COLNAMES_INTEREST_PRESSURE_TEST

IMPACT_OUTCOMES

EXCLUDED_DISEASES

N_TS_MIN_CHARS

N_TS_YEAR_CHARS

MIN_TS_YEAR

MAX_TS_YEAR

MIN_TS_MONTH

MAX_TS_MONTH

DEF_TOUCHSTONE_OLD

DEF_TOUCHSTONE_NEW

DEF_TOUCHSTONE_OLD_OLD

COLOUR_VIMC

PINE

Example of VIMC burden template provided to modellers

Description

An example of the central burden template provided by VIMC to modelling groups.

Usage

eg_burden_template

Format

eg_burden_template

A data frame with 10,201 rows and 11 columns:

disease

Disease name

year

Year

age

Age

country

Country name in short format; this is a placeholder name.

country_name

Country name in long format; this is a placeholder.

cases

Cases of the disease averted

.

dalys

DALYs averted

.

deaths

Deaths averted

.

yll

Years of life-loss averted

.

cohort_size

Population size of the country in a year

.

scenario

Vaccination scenario.

Source

Prepared by the VIMC secretariat.


Example of scenario coverage data

Description

Example of scenario coverage data

Usage

eg_coverage

Format

eg_coverage

A data frame with 11 rows and 19 columns.

scenario_type

Scenario type name.

scenario_type_description

Scenario type description string.

scenario

Scenario name string.

scenario_description

Scenario description string.

coverage_set

Coverage set string.

gavi_support_level

String for whether GAVI supported the scenario.

source_from

String identifier for the source.

disease

Infection identifier.

vaccine

Vaccine identifier.

activity_type

Vaccination activity identifier.

year

Year

country

Country name in short format; this is a placeholder name.

age_from

Age limit lower limit.

age_to

Age limit upper limit.

age_range_verbatim

Description of age range.

target

Target for vaccination.

coverage

Proportional coverage.

gender

Sex to which data applies, may be "Male", "Female", or "Both".

proportion_risk

Proportional risk value.

Source

Prepared by the VIMC secretariat.


Example of FVP estimate data

Description

Example data of fully-vaccinated persons (FVPs).

Usage

eg_fvps

Format

eg_fvps

A data frame with 11 rows and 24 columns:

scenario_type

Scenario type name.

scenario_type_description

Scenario type description string.

scenario

Scenario name string.

scenario_description

Scenario description string.

coverage_set

Coverage set string.

gavi_support_level

String for whether GAVI supported the scenario.

source_from

String identifier for the source.

disease

Infection identifier.

vaccine

Vaccine identifier.

activity_type

Vaccination activity identifier.

year

Year

country

Country name in short format; this is a placeholder name.

age_from

Age limit lower limit.

age_to

Age limit upper limit.

age_range_verbatim

Description of age range.

target

Target for vaccination.

coverage

Proportional coverage.

gender

Sex to which data applies, may be "Male", "Female", or "Both".

proportion_risk

Proportional risk value.

job

Job code as a numeric.

fvps

Count of FVPs.

fvps_adjusted

Count of adjusted FVPs.

target_adjusted

Adjusted vaccination target.

coverage_adjusted

Ratio of adjusted FVPs to adjusted target.

Source

Prepared by the VIMC secretariat.


A second FVP data example

Description

Exampled data for fully-vaccinated persons, created manually from arbitrary data.

Usage

eg_fvps_2

Format

eg_fvps_2

A data frame with 4 rows and 7 columns:

country

Country name as ISO 3 character code.

year

Year.

activity_type

Vaccination activity identifier.

scenario_type

Scenario type name.

vaccine

Vaccine identifier.

coverage_adjusted

Ratio of adjusted FVPs to adjusted target.

fvps

Count of fully vaccinated persons.

Source

Example data prepared by the VIMC secretariat.


Example of impact data

Description

Example of vaccine impact data taken from data used to test vimpact. This data is primarily used for testing here too.

Usage

eg_impact

Format

eg_impact

A data frame with 5396 rows and 9 columns:

disease

Disease name.

vaccine

Vaccine identifier.

modelling_group

Modelling group name.

country

Country ISO 3-character code.

country_name

Country name.

year

Year for which impacts are modelled.

activity_type

Activity type: either "routine" or "campaign."

burden_outcome

Name of the burden outcome; one of "deaths_averted" or "dalys_averted".

impact

Value of the impact

.

Source

Prepared by the VIMC secretariat.


Second example of impact data

Description

Second example of impact data

Usage

eg_impact_2

Format

eg_impact_2

A data frame with 4 rows and 6 columns:

country

Example country identifier.

year

Year.

birth_cohort

Numeric for the birth year.

burden_outcome

Outcome identifier.

impact

Numeric for impact.

short_name

Example identifier.

Source

Prepared manually by the VIMC secretariat.


Example of UN-WPP time-series data

Description

An example of the population estimate data used by VIMC.

Usage

eg_wpp

Format

eg_wpp

A data frame with 65,448 rows and 5 columns:

country

Country name; this is a placeholder name.

year

Year

age

Age

gender

Sex given as three categories, "Male", "Female", or "Both"

.

value

Population size

Source

Derived from data originally prepared by the United Nations as part of the World Population Prospects: https://population.un.org/wpp/.


Filter data for touchstones or diseases

Description

A pair of helper functions allowing filtering out of recent touchstone values and excluded diseases.

Usage

filter_recent_ts(df, threshold = DEF_TOUCHSTONE_NEW)

filter_excluded_diseases_ts(df, threshold = DEF_TOUCHSTONE_OLD_OLD)

flag_duplicates(df, key_cols = COLNAMES_KEY_PRESSURE_TEST)

filter_invalid_trajectories(
  df,
  prev_data,
  outcome = c("deaths_averted", "dalys_averted")
)

Arguments

df

A ⁠<data.frame>⁠ holding impact data. This data.frame is not checked for contents

threshold

A six-digit number that is checked as a valid touchstone identifier (YYYYMM format) using validate_ts_year(). Defaults to DEF_TOUCHSTONE_NEW ("202310").

key_cols

Key columns in df to check for duplicates.

prev_data

A ⁠<data.frame>⁠ holding data from a previous touchstone for the same scenarios as df.

outcome

A string giving the outcome of interest; may be one of "deaths_averted" or "dalys_averted".

Value

A filtered ⁠<data.frame>⁠.

  • filter_recent_ts() returns df with rows where the touchstone condition is not met excluded.

  • filter_excluded_diseases_ts() returns df with rows where rows relating to the EXCLUDED_DISEASES, when the touchstone year in df is less than the threshold, excluded.

  • flag_duplicates() returns df with duplicated combinations of key_cols flagged using the column n_key (or a user-defined name).

  • filter_invalid_trajectories() returns df with bad outcome trajectories (NA to non-NA) removed.


Flag significant changes in impact estimates

Description

Calculates and flags whether the difference in impact estimates between touchstones is greater than expected. A row is flagged if the difference is greater than threshold ×\times the inter-quartile range for cases where the IQR is greater than zero.

Usage

flag_large_diffs(
  changes_list,
  iqr_df,
  variable = c("deaths_averted", "dalys_averted"),
  group_cols = c("country", "vaccine", "activity_type"),
  threshold = 100,
  touchstone_old = DEF_TOUCHSTONE_OLD_OLD,
  touchstone_new = DEF_TOUCHSTONE_NEW
)

Arguments

changes_list

A list of data.frames with one element per variable of interest (see variable). Usually generated using generate_diffs().

iqr_df

A data.frame of inter-quartile differences generated using gen_national_iqr().

variable

A string specifying the variable of interest. Must be one of "deaths_averted" or "dalys_averted", and must be present as a name and element of changes_list.

group_cols

A character vector of grouping columns. Defaults to "country", "vaccine", "activity_type".

threshold

A single numeric value for the IQR multiplier. Defaults to 100.

touchstone_old

The previous touchstone identifier. Defaults to DEF_TOUCHSTONE_OLD_OLD.

touchstone_new

The new touchstone identifier. Defaults to DEF_TOUCHSTONE_NEW.

Value

A filtered data.frame of differences in impact estimates flagged as too large. Rows with differences within tolerance are removed.


Combine and align data from two touchstones

Description

Generates a full join of two data.frames, selecting for columns of interest.

Usage

gen_combined_df(
  prev_dat,
  df_clean,
  interest_cols = COLNAMES_INTEREST_PRESSURE_TEST,
  key_cols = COLNAMES_KEY_PRESSURE_TEST
)

Arguments

prev_dat

A data.frame of impact estimates corresponding to an earlier touchstone.

df_clean

A data.frame of impact estimates corresponding to a more recent touchstone.

interest_cols

A character vector of columns of interest. Defaults to COLNAMES_INTEREST_PRESSURE_TEST.

key_cols

A character vector of columns of interest. Defaults to COLNAMES_KEY_PRESSURE_TEST.

Value

A data.frame which is a full join of prev_dat and df_clean. Columns are disambiguated with the suffixes "_old" and "_new".


Generate IQR for key outcomes

Description

Generate IQR for key outcomes

Usage

gen_national_iqr(
  df,
  group_cols = c("country", "vaccine", "activity_type"),
  value_cols = c("deaths_averted", "dalys_averted"),
  prefix = "national_iqr"
)

Arguments

df

A data.frame of impact estimates.

group_cols

A character vector of grouping columns. Defaults to "country", "vaccine", "activity_type".

value_cols

A character vector of value columns. Defaults to "deaths_averted" and "dalys_averted".

prefix

A string for the prefix applied to every IQR summary column. Defaults to "national_iqr".

Value

A ⁠<data.frame>⁠ with the inter-quartile range of the columns in value_cols, with the column name constructed as ⁠{prefix}_{value_col}⁠ using string interpolation.


Explore significant changes in deaths and DALYs

Description

Explore significant changes in deaths and DALYs

Usage

generate_diffs(
  prev_df,
  curr_df,
  interest_cols = COLNAMES_INTEREST_PRESSURE_TEST,
  key_cols = COLNAMES_KEY_PRESSURE_TEST,
  touchstone = DEF_TOUCHSTONE_OLD
)

Arguments

prev_df

A ⁠<data.frame>⁠ of impact estimates from the previous touchstone.

curr_df

A ⁠<data.frame>⁠ of impact estimates for the current touchstone.

interest_cols

A character vector of columns to check for differences. Defaults to COLNAMES_INTEREST_PRESSURE_TEST.

key_cols

A character vector of columns to use when assigning campaign identifiers. Passed to add_campaign_id(), defaults to COLNAMES_KEY_PRESSURE_TEST.

touchstone

A six character string that can be converted to a six digit numeric giving a touchstone identifier in YYYYMM format.

Value

A list of tibbles of differences between prev_df and curr_df, with one list element per element of interest_cols.


Plot burden and impact diagnostics

Description

Plotting functions for burden diagnostics. All functions operate on data prepared for plotting by a corresponding plotting-preparation function.

Usage

plot_compare_demography(data, fig_number)

plot_age_patterns(burden_age, fig_number)

plot_global_burden_decades(burden_decades, fig_number)

plot_global_burden(burden_data, outcome_name, fig_number)

plot_coverage_set(coverage_set, fig_number)

plot_fvp(fvp_data, fig_number)

Arguments

data

A ⁠<data.frame>⁠ that gives the comparison between VIMC-provided and modeller-used demography values, in long-format. This is expected to be the output of check_demography_alignment() processed by prep_plot_demography().

fig_number

The figure number displayed in the plot title.

burden_age

A ⁠<tibble>⁠ with the minimum column names "age", "value_millions", "burden_outcome", and "scenario"; expected to be the output of prep_plot_age().

burden_decades

A ⁠<tibble>⁠ giving the burden by decade, up to year_max; expected to be the output of prep_plot_burden_decades().

burden_data

This is expected to be a ⁠<tibble>⁠ from a nested-⁠<tibble>⁠ constructed using prep_plot_global_burden().

outcome_name

A string for an outcome name. Allowed outcome names are given in the package constant constants.

coverage_set

A ⁠<tibble>⁠ that is the output of prep_plot_coverage_set().

fvp_data

A ⁠<tibble>⁠ of estimates of fully-vaccinated persons (FVPs) per scenario, with scenarios as factors in order of the number of adjusted-FVPs. Expected to be the output of prep_plot_fvp().

Value

A ⁠<ggplot>⁠ object that can be printed to screen in the plot frame or saved to an output device (i.e., saved as an image file).


Plot coverage and fully vaccinated persons (FVPs)

Description

Generates plots of routine vaccine coverage and fully vaccinated persons (FVPs) over time for selected countries.

Usage

plot_coverage_fvps(fvps, country = PINE)

Arguments

fvps

A data.frame (or class extending it) showing the number of FVPs (fully vaccinated persons) by country, year and scenario/activity type.

country

A character vector of country identifiers, with all identifiers expected to be found in fvps. Defaults to PINE countries.

Value

A named list with two ggplot objects:

coverage

A plot of routine vaccine coverage over time.

fvps

A plot of fully vaccinated persons over time.

If there is no data on routine vaccination in the dataset, the coverage element of the return will be an empty ⁠<ggplot>⁠ object, and a warning is thrown.

Examples

fvps <- eg_fvps_2

plots <- plot_coverage_fvps(fvps, "AGO")
plots$coverage
plots$fvps

Plot central impact estimates by cohort and year

Description

Produces faceted plots of central impact estimates for priority countries, stratified either by birth cohort or by year of vaccination. Impact metrics include cases, deaths, DALYs, and YLLs.

Usage

plot_impact(
  data,
  country = PINE,
  burden_type = c("cases", "deaths", "dalys", "yll"),
  view = c("cohort", "year"),
  title = NULL
)

Arguments

data

A tibble containing impact estimates.

country

The country names as a character vector. Defaults to PINE countries.

burden_type

Burden metric used to evaluate impact; may be one of: ⁠"cases", "deaths", "dalys", "yll"⁠.

view

A string for the way impact is assigned, either by birth cohort ("cohort") or by year of vaccination ("year").

title

Title of the plot to be rendered. Defaults to NULL.

Value

ggplot object showing central impact estimates

Examples

impact_data <- eg_impact_2

plot_impact(
  data = impact_data,
  "A",
  burden_type = "cases",
  title = "Cases averted",
  view = "year"
)

Create impact diagnostics plots

Description

Functions that create impact diagnostics plots (or plotting objects). All functions are associated with one other upstream data processing function, and can be used in a pipe with that function. Where appropriate, outcome selection and label preparation is automated to reduce function arguments.

Plotting functions for impact diagnostics. See plotting-preparation functions for a set of helper functions that prepare impact diagnostics for plotting. See the details of the data argument for functions that help to prepare the data.

Usage

plot_sig_diff(data, outcome = IMPACT_OUTCOMES)

plot_diff(
  data,
  outcome = IMPACT_OUTCOMES,
  group_vars = IMPACT_GROUP_VARS,
  touchstone_old = DEF_TOUCHSTONE_OLD,
  touchstone_new = DEF_TOUCHSTONE_NEW
)

plot_modelling_group_variation(data)

plot_vaccine_gavi(data)

plot_cumul(data)

Arguments

data

A data.frame suitable for plotting.

outcome

A string for the impact outcome. One of IMPACT_OUTCOMES.

group_vars

A single string for the grouping variables. May be any of IMPACT_OUTCOMES, which are "activity_type" and "vaccine".

touchstone_old

A string for the previous touchstone in format "YYYYMM". Defaults to DEF_TOUCHSTONE_OLD.

touchstone_new

A string for the current or new touchstone in format "YYYYMM". Defaults to DEF_TOUCHSTONE_NEW.

Value

A ⁠<ggplot2>⁠ object that can be viewed or saved.


Prepare data for plotting

Description

Transform burden estimate data from modelling groups to make them suitable for plotting using an appropriate plotting function. Each preparation function corresponds to a plotting function.

Usage

prep_plot_demography(burden)

prep_plot_age(burden)

prep_plot_burden_decades(burden, year_max)

prep_plot_global_burden(burden)

prep_plot_coverage_set(coverage)

prep_plot_fvp(fvp, year_min, year_max)

Arguments

burden

For prep_plot_demography(), a ⁠<tibble>⁠ output from check_demography_alignment(). For other functions, a burden dataset similar to eg_burden_template.

year_max

The maximum year to be represented in a subsequent figure. For prep_plot_burden_decades(), must be a decade, i.e., multiple of 10.

coverage

WIP. Coverage data.

fvp

WIP. Data on counts of fully vaccinated persons.

year_min

Minimum year.

Value

  • For prep_plot_demography(): a ⁠<tibble>⁠ in long-format, with the identifier-columns, "scenario", "age", and "year", with the added column "value_millions".

  • For prep_plot_age(): a ⁠<tibble>⁠ with the columns "scenario", "burden_outcome", "age", "value_millions".

  • For prep_plot_burden_decades(): a ⁠<tibble>⁠ with the columns "scenario", "burden_outcome", "decade_label", and "value_millions".

  • For prep_plot_global_burden(): a nested ⁠<tibble>⁠ with the string column "burden_outcome", and a list column of tibbles "burden_data".

  • For prep_plot_coverage_set(): WIP

  • For prep_plot_fvp(): WIP.


Prepare impact diagnostics for plotting

Description

A suite of helper functions that sit between impact diagnostics functions and plotting functions. These functions transform and aggregate impact estimates to prepare them for visualisation. Functions have basic checks on input data but otherwise assume users will not modify inputs.

Usage

prep_plot_mod_grp_varn(df2, df3, outcome = IMPACT_OUTCOMES)

prep_plot_vax_gavi(
  data,
  prev_data,
  outcome = IMPACT_OUTCOMES,
  touchstone_old = DEF_TOUCHSTONE_OLD,
  touchstone_new = DEF_TOUCHSTONE_NEW
)

prep_plot_cumul(
  data,
  outcome,
  disease,
  touchstone_old = DEF_TOUCHSTONE_OLD,
  touchstone_new = DEF_TOUCHSTONE_NEW
)

Arguments

df2

A ⁠<tibble>⁠ of impact estimates with at least columns modelling_group, vaccine, outcome variable, and fvps (doses delivered). Used as the primary data source for calculations in prep_plot_mod_grp_varn().

df3

A ⁠<tibble>⁠ of modelling group and vaccine combinations, typically with one row per modelling group per vaccine. Joined with df2 to ensure complete group coverage in prep_plot_mod_grp_varn().

outcome

A character string for the impact outcome. Must be one of "deaths_averted" or "dalys_averted". For prep_plot_cumul(), data must include columns named ⁠{outcome}_old⁠ and ⁠{outcome}_new⁠.

data

A ⁠<tibble>⁠ of impact estimates with columns including at least those in COLNAMES_KEY_PRESSURE_TEST, the outcome variable, and potentially other columns for analysis.

prev_data

A ⁠<tibble>⁠ of impact estimates from a previous touchstone, used as a comparison baseline. Should have the same structure as data.

touchstone_old

A six-character touchstone identifier (YYYYMM format) for the previous dataset. Defaults to DEF_TOUCHSTONE_OLD. Used in prep_plot_vax_gavi() and prep_plot_cumul().

touchstone_new

A six-character touchstone identifier (YYYYMM format) for the current dataset. Defaults to DEF_TOUCHSTONE_NEW. Used in prep_plot_vax_gavi() and prep_plot_cumul().

disease

A character string specifying a single disease for filtering and analysis.

Value

  • prep_plot_mod_grp_varn() returns a grouped ⁠<tibble>⁠ (grouped by vaccine) with all columns from df2 and df3 plus derived columns: adj_outc (adjusted outcome with small offset), outcome_name (input outcome), and mean_outc (vaccine-level weighted mean outcome).

  • prep_plot_vax_gavi() returns a ⁠<tibble>⁠ with columns disease, year, yearly_outcome, dataset (factor with levels for old touchstone, "Difference", and new touchstone), and outcome_name. Summarizes outcomes by disease and year across two touchstones.

  • prep_plot_cumul() returns a ⁠<tibble>⁠ with columns year, modelling_group, touchstone, value (cumulative or average outcome), line_type ("solid" for individual models, "dashed" for model average), and outcome_name. Returns NULL if the specified disease has no non-zero data to plot.


Plotting theme for vimcheck

Description

A simple plotting theme building on ggplot2::theme_bw().

Usage

theme_vimc(x_text_angle = 45, y_text_angle = 0, ...)

theme_vimc_noxaxis()

Arguments

x_text_angle

The angle for X-axis labels. Defaults to 45 degrees.

y_text_angle

The angle for Y-axis labels. Defaults to 0 degrees.

...

<dynamic-dots> Other arguments passed to ggplot2::theme(). These will be applied in addition to, or in place of, pre-existing elements defined by this theme. See the examples for this theme's appearance.

Value

A ggplot2 theme that can be added to ggplot2 plots or objects.

Examples

# using an inbuilt dataset
data(mtcars)

# standard theme
ggplot2::ggplot(mtcars, ggplot2::aes(disp, mpg)) +
  ggplot2::geom_point() +
  theme_vimc()

# with X-axis suppression
ggplot2::ggplot(mtcars, ggplot2::aes(disp, mpg)) +
  ggplot2::geom_point() +
  theme_vimc_noxaxis()

Save pressure-testing diagnostics to local file

Description

Save pressure-testing diagnostics data.frames to local compressed files in the .Rds format. Input data.frames are generated by other package functions and are not checked here.

Usage

save_outputs(
  missing_in_current,
  missing_deaths,
  missing_dalys,
  changes_deaths,
  changes_dalys,
  subregional_flags_deaths_camp,
  subregional_flags_deaths_rout,
  subregional_flags_dalys_camp,
  subregional_flags_dalys_rout,
  output_dir = here::here("outputs")
)

Arguments

missing_in_current

A data.frame.

missing_deaths

A data.frame that is the output of filter_invalid_trajectories() with the outcome "deaths_averted".

missing_dalys

A data.frame that is the output of filter_invalid_trajectories() with the outcome "dalys_averted".

changes_deaths

A data.frame that is the output of flag_large_diffs() with the outcome "deaths_averted".

changes_dalys

A data.frame that is the output of flag_large_diffs() with the outcome "dalys_averted".

subregional_flags_deaths_camp

A data.frame that is the output of compare_natl_subreg() with the outcome "deaths_averted_rate" for the "campaign" activity type.

subregional_flags_deaths_rout

A data.frame that is the output of compare_natl_subreg() with the outcome "deaths_averted_rate" for the "routine" activity type.

subregional_flags_dalys_camp

A data.frame that is the output of compare_natl_subreg() with the outcome "dalys_averted_rate" for the "campaign" activity type.

subregional_flags_dalys_rout

A data.frame that is the output of compare_natl_subreg() with the outcome "dalys_averted_rate" for the "campaign" activity type.

output_dir

A writeable directory. Defaults to "./outputs".

Value

None. Called for the convenience side-effect of saving data.frames as .Rds format.


Validate files in a burden estimate

Description

Check that incoming data files in a burden estimate are complete, and that no extra files have been included. This function expects that incoming burden files are in the directory given by path_burden, which holds a file dictionary which maps each data file to a specific scenario.

Usage

validate_complete_incoming_files(path_burden = "incoming_burden_estimates")

Arguments

path_burden

A directory with burden estimate data.

Value

A ⁠<tibble>⁠ of the scenario file dictionary in path_burden if all checks pass. Otherwise, exits with informative errors on failed checks.


Validate file dictionary template

Description

Function to create a file_dictionary template. It maps to touchstone disease scenarios and you will see expected number of scenarios i.e. the number of files that we expect from a model. Users should populate the file column to match the scenario-file. This function will run if a file_dictionary.csv file does not exist

Usage

validate_file_dict_template(disease, path_burden = "incoming_burden_estimates")

Arguments

disease

A disease identifier.

path_burden

A directory with burden estimate data.

Value

Nothing; called primarily for its side-effects. If the file path_burden/file_dictionary.csv does not exist, a file dictionary CSV file is written to the same location. Prints a message to screen informing the user whether any action has been taken.


Check incoming burden set against template

Description

Identify extra and missing columns and rows in burden data.

Usage

validate_template_alignment(burden_set, template)

Arguments

burden_set

A ⁠<data.frame>⁠ of modeller-provided burden-set data.

template

A ⁠<data.frame>⁠ of the burden template as provided to modelling groups by VIMC.

Value

A named list of checks carried out on burden_set to compare it against template, with information on missing and extra data.


Data on countries in WHO subregions

Description

Data that groups countries into WHO subregions.

Usage

who_subregions

Format

who_subregions

A data frame with 249 rows and 9 columns:

choice_subregion

Sub-region three character code with added letter identifier.

country_name

Country name in long form.

country

ISO 3 character country code.

Global.Name

A constant, 'World'.

Region.Name

Continent-scale region identifier.

Sub.region

Sub-continental scale region identifier.

Intermediate.Region.Name

Alternative regional scale identifier.

subregion

Sub-regional identifier.

vimc117

Logical identifier.

Source

Prepared by the VIMC secretariat.