Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c8b4bc1
Add initial fns from pressure testing report
pratikunterwegs Mar 12, 2026
db03465
Move pressure testing plotting
pratikunterwegs Mar 12, 2026
50f6b0d
Clean up funs and add constants
pratikunterwegs Mar 12, 2026
13d6244
Clean up fns and add constants
pratikunterwegs Mar 13, 2026
8aa8494
Rename files
pratikunterwegs Mar 13, 2026
de1eda6
Add checks and docs for pressure testing fns
pratikunterwegs Apr 20, 2026
46d3d97
Add pkg constants
pratikunterwegs Apr 20, 2026
63e5871
Add pkg helpers
pratikunterwegs Apr 20, 2026
ffff840
WIP separate plot prep from plot code
pratikunterwegs Apr 20, 2026
d0237fb
WIP add docs and pkg infra
pratikunterwegs Apr 21, 2026
4a52fbb
Reorganise docs
pratikunterwegs Apr 21, 2026
bba30c5
WIP plotting and prep fns impact diagnostics
pratikunterwegs Apr 21, 2026
a455c5a
Add constants
pratikunterwegs Apr 21, 2026
beb2a07
Update plot prep and plot fns
pratikunterwegs Apr 21, 2026
0424f17
Fixes from initial test run
pratikunterwegs Apr 22, 2026
386be9b
Update infra, bump to v0.0.4
pratikunterwegs Apr 22, 2026
43753fb
Rename fn file, fix arg name
pratikunterwegs Apr 22, 2026
474fdc3
Fn filter dups only flags instead
pratikunterwegs Jun 4, 2026
4873b45
More sensible checks on fns
pratikunterwegs Jun 4, 2026
50b5389
Add test data from vimpact
pratikunterwegs Jun 5, 2026
5024eb9
Minor fixes to fns
pratikunterwegs Jun 5, 2026
991d479
Add test suite for impact fns
pratikunterwegs Jun 5, 2026
9663b5c
Update docs and NEWS
pratikunterwegs Jun 5, 2026
72dff25
Minor edits to fns
pratikunterwegs Jun 8, 2026
97585b1
Add tests for plotting fns
pratikunterwegs Jun 8, 2026
113b551
Update wordlist and add design vignette
pratikunterwegs Jun 8, 2026
d87f5a0
WIP pressure testing vignette
pratikunterwegs Jun 9, 2026
1f1ac93
Minor updates, update vignette
pratikunterwegs Jun 9, 2026
812311d
Fix docs issues
pratikunterwegs Jun 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
^scratch\.R$
^scratch$
^data-raw$
^jarl\.toml$
8 changes: 6 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: vimcheck
Title: Diagnostics for Vaccine Impact Modelling Consortium Burden and
Impact Estimates
Version: 0.0.3
Version: 0.0.4
Authors@R: c(
person("Pratik", "Gupte", , "p.gupte24@imperial.ac.uk", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5294-7819")),
Expand All @@ -24,13 +24,17 @@ Depends:
Imports:
checkmate,
cli,
diffdf,
dplyr,
forcats,
ggplot2,
ggridges,
glue,
here,
readr,
rlang,
scales,
stats,
stringr,
tidyr
Suggests:
Expand All @@ -48,4 +52,4 @@ Encoding: UTF-8
Language: en-GB
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
40 changes: 40 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,20 +1,56 @@
# Generated by roxygen2: do not edit by hand

export(COLNAMES_INTEREST_PRESSURE_TEST)
export(COLNAMES_KEY_PRESSURE_TEST)
export(COLOUR_VIMC)
export(DEF_TOUCHSTONE_NEW)
export(DEF_TOUCHSTONE_OLD)
export(DEF_TOUCHSTONE_OLD_OLD)
export(EXCLUDED_DISEASES)
export(IMPACT_OUTCOMES)
export(MAX_TS_MONTH)
export(MAX_TS_YEAR)
export(MIN_TS_MONTH)
export(MIN_TS_YEAR)
export(N_TS_MIN_CHARS)
export(N_TS_YEAR_CHARS)
export(basic_burden_sanity)
export(burden_outcome_names)
export(check_demography_alignment)
export(colnames_df_missing_cols)
export(colnames_plot_demog_compare)
export(compare_natl_subreg)
export(file_dict_colnames)
export(filter_excluded_diseases_ts)
export(filter_invalid_trajectories)
export(filter_recent_ts)
export(flag_duplicates)
export(flag_large_diffs)
export(gen_combined_df)
export(gen_national_iqr)
export(generate_diffs)
export(plot_age_patterns)
export(plot_compare_demography)
export(plot_coverage_set)
export(plot_cumul)
export(plot_diff)
export(plot_fvp)
export(plot_global_burden)
export(plot_global_burden_decades)
export(plot_modelling_group_variation)
export(plot_sig_diff)
export(plot_vaccine_gavi)
export(prep_plot_age)
export(prep_plot_burden_decades)
export(prep_plot_coverage_set)
export(prep_plot_cumul)
export(prep_plot_demography)
export(prep_plot_fvp)
export(prep_plot_global_burden)
export(prep_plot_mod_grp_varn)
export(prep_plot_vax_gavi)
export(save_outputs)
export(scenario_data_colnames)
export(theme_vimc)
export(theme_vimc_noxaxis)
export(validate_complete_incoming_files)
Expand All @@ -26,12 +62,16 @@ importFrom(ggplot2,facet_grid)
importFrom(ggplot2,facet_wrap)
importFrom(ggplot2,geom_col)
importFrom(ggplot2,geom_hline)
importFrom(ggplot2,geom_point)
importFrom(ggplot2,geom_segment)
importFrom(ggplot2,ggplot)
importFrom(ggplot2,label_wrap_gen)
importFrom(ggplot2,labeller)
importFrom(ggplot2,labs)
importFrom(ggplot2,scale_fill_distiller)
importFrom(ggplot2,scale_x_continuous)
importFrom(ggplot2,scale_y_continuous)
importFrom(ggplot2,theme)
importFrom(ggplot2,vars)
importFrom(rlang,":=")
importFrom(rlang,.data)
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# vimcheck 0.0.4

- Added impact diagnostics functions in `R/fn_impact_diagnostics.R`.

- Added test data originally used in [vimpact](https://github.com/vimc/vimpact) for use with vimcheck.

- Added plotting preparation functions and plotting functions in `R/fn_plotting_prep_impact_diagnostics.R` and `R/fn_plotting_impact_diagnostics.R`.

- Added dependencies _diffdf_ and _here_.

- Added vignette on design decisions and pressure testing functions.

# vimcheck 0.0.3

- Separated data-prep for plotting from plotting functions.
Expand Down
169 changes: 169 additions & 0 deletions R/constants.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#' Package constants
#'
#' @description
#' Constant values used in _vimcheck_. See the **Examples** section for the
#' constant values.
#'
#' @name constants
#' @rdname constants
#'
#' @keywords constants
#'
#' @examples
#' file_dict_colnames
#'
#' @export
file_dict_colnames <- c(
"scenario_type",
Expand All @@ -15,6 +22,11 @@ file_dict_colnames <- c(
)

#' @name constants
#'
#' @examples
#' scenario_data_colnames
#'
#' @export
scenario_data_colnames <- c(
"scenario_type",
"scenario_type_description",
Expand All @@ -23,6 +35,11 @@ scenario_data_colnames <- c(
)

#' @name constants
#'
#' @examples
#' burden_outcome_names
#'
#' @export
burden_outcome_names <- c(
"cases",
"deaths",
Expand All @@ -37,6 +54,11 @@ burden_outcome_names <- c(
)

#' @name constants
#'
#' @examples
#' colnames_plot_demog_compare
#'
#' @export
colnames_plot_demog_compare <- c(
"variable",
"scenario",
Expand All @@ -46,3 +68,150 @@ colnames_plot_demog_compare <- c(
"value",
"value_millions"
)

#' @name constants
#'
#' @examples
#' colnames_df_missing_cols
#'
#' @export
colnames_df_missing_cols <- c(
"country_name",
"vaccine",
"activity_type",
"year",
"modelling_group"
)

#' @name constants
#'
#' @examples
#' COLNAMES_KEY_PRESSURE_TEST
#'
#' @export
COLNAMES_KEY_PRESSURE_TEST <- c(
"country",
"country_name",
"vaccine",
"activity_type",
"year",
"disease",
"modelling_group"
)

#' @name constants
#'
#' @examples
#' COLNAMES_INTEREST_PRESSURE_TEST
#'
#' @export
COLNAMES_INTEREST_PRESSURE_TEST <- union(
COLNAMES_KEY_PRESSURE_TEST,
c(
"fvps",
"target_population",
"coverage",
"deaths_averted",
"dalys_averted",
"deaths_averted_rate",
"dalys_averted_rate"
)
)

#' @name constants
#'
#' @examples
#' IMPACT_OUTCOMES
#'
#' @export
IMPACT_OUTCOMES <- c("deaths_averted", "dalys_averted")

IMPACT_GROUP_VARS <- c("activity_type", "vaccine")

#' @name constants
#'
#' @examples
#' EXCLUDED_DISEASES
#'
#' @export
EXCLUDED_DISEASES <- c("Hib", "PCV", "Rota", "JE")

#' @name constants
#'
#' @examples
#' N_TS_MIN_CHARS
#'
#' @export
N_TS_MIN_CHARS <- 6L

#' @name constants
#'
#' @examples
#' N_TS_YEAR_CHARS
#'
#' @export
N_TS_YEAR_CHARS <- 4L

#' @name constants
#'
#' @examples
#' MIN_TS_YEAR
#'
#' @export
MIN_TS_YEAR <- 2000

#' @name constants
#'
#' @examples
#' MAX_TS_YEAR
#'
#' @export
MAX_TS_YEAR <- 2100

#' @name constants
#'
#' @examples
#' MIN_TS_MONTH
#'
#' @export
MIN_TS_MONTH <- 1

#' @name constants
#'
#' @examples
#' MAX_TS_MONTH
#'
#' @export
MAX_TS_MONTH <- 12

#' @name constants
#'
#' @examples
#' DEF_TOUCHSTONE_OLD
#'
#' @export
DEF_TOUCHSTONE_OLD <- "201910"

#' @name constants
#'
#' @examples
#' DEF_TOUCHSTONE_NEW
#'
#' @export
DEF_TOUCHSTONE_NEW <- "202310"

#' @name constants
#'
#' @examples
#' DEF_TOUCHSTONE_OLD_OLD
#'
#' @export
DEF_TOUCHSTONE_OLD_OLD <- "202110"

#' @name constants
#'
#' @examples
#' COLOUR_VIMC
#'
#' @export
COLOUR_VIMC <- "#008080"
23 changes: 23 additions & 0 deletions R/data_who_subregions.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#' Data on countries in WHO subregions
#'
#' Data that groups countries into WHO subregions.
#'
#' @format ## `who_subregions`
#' A data frame with 249 rows and 9 columns:
#' \describe{
#' \item{choice_subregion}{Sub-region three character code with added letter
#' identifier.}
#' \item{country_name}{Country name in long form.}
#' \item{country}{ISO 3 character country code.}
#' \item{Global.Name}{A constant, 'World'.}
#' \item{Region.Name}{Continent-scale region identifier.}
#' \item{Sub.region}{Sub-continental scale region identifier.}
#' \item{Intermediate.Region.Name}{Alternative regional scale identifier.}
#' \item{subregion}{Sub-regional identifier.}
#' \item{vimc117}{Logical identifier.}
#' }
#'
#' @keywords data
#'
#' @source Prepared by the VIMC secretariat.
"who_subregions"
25 changes: 25 additions & 0 deletions R/example_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,28 @@
#'
#' @source Prepared by the VIMC secretariat.
"eg_fvps"

#' Example of impact data
#'
#' Example of vaccine impact data taken from data used to test \pkg{vimpact}.
#' This data is primarily used for testing here too.
#'
#' @format ## `eg_impact`
#' A data frame with 5396 rows and 9 columns:
#' \describe{
#' \item{disease}{Disease name.}
#' \item{vaccine}{Vaccine identifier.}
#' \item{modelling_group}{Modelling group name.}
#' \item{country}{Country ISO 3-character code.}
#' \item{country_name}{Country name.}
#' \item{year}{Year for which impacts are modelled.}
#' \item{activity_type}{Activity type: either "routine" or "campaign."}
#' \item{burden_outcome}{Name of the burden outcome; one of "deaths_averted"
#' or "dalys_averted".}
#' \item{impact}{Value of the impact}.
#' }
#'
#' @keywords data
#'
#' @source Prepared by the VIMC secretariat.
"eg_impact"
Loading
Loading