Skip to contents
  • validate_all_data(): Validate all data required by the package.

  • validate_vs_info(): Validate vaccination schedule table.

  • validate_efficacy(): Validate efficacy data.

  • validate_ri_data(): Validate routine immunization data.

  • validate_live_births(): [Deprecated] Validate live births data. This function is deprecated as of version 0.2.0 as live births data should now be included in the routine immunization data. This function will be removed in a future version.

  • validate_birth_seasonality(): Validate birth seasonality data.

  • validate_sample_pair(): Validate sample pair.

  • validate_vax_imm_type(): Validate vaccine immunity type.

Usage

validate_all_data(
  vs_info,
  efficacy,
  ri_data,
  live_births = deprecated(),
  ...,
  birth_seasonality = NULL,
  sample_pair = NULL,
  vax_imm_type = NULL
)

validate_vs_info(vs_info, ..., preprocessed = FALSE)

validate_efficacy(efficacy, vs_info, ..., preprocessed = FALSE)

validate_ri_data(ri_data, vs_info)

validate_live_births(live_births)

validate_birth_seasonality(birth_seasonality)

validate_sample_pair(sample_pair, ri_data)

validate_vax_imm_type(vax_imm_type, vs_info)

Arguments

vs_info

[data.frame] The vaccination schedule table preprocessed with preprocess_vs_info() which is structured as prep_dummy_vs_info. dummy_vs_info defines the structure of the raw format before preprocessing.

efficacy

[data.frame] Vaccine doses efficacy estimates table preprocessed with preprocess_efficacy() which is structured as prep_dummy_efficacy. efficacy_default defines the structure of the raw format before preprocessing.

ri_data

[data.frame] Routine immunization data in the format required by impute_missing_doses(). Missing values are permitted only in vaccine-dose columns.

live_births

[data.frame] [Deprecated] Number of babies born in a given admin unit in a given year. This argument is deprecated as of version 0.2.0. Please include the live births data in the routine immunization data (ri_data) instead with its column named according to birth argument in config_pviem().

...

Forces optional arguments to be passed by name and allows for future extensions without breaking existing code. Must be empty.

birth_seasonality

As defined in shift_doses().

sample_pair

As defined in impute_missing_doses().

vax_imm_type

As defined in compute_immunity_by_type().

preprocessed

[logical(1)] TRUE means the data is preprocessed while FALSE means it isn't.

Value

[logical(1)] Throws an error if the validation fails, with descriptive messages or returns invisibly TRUE.

Validation rules

General rules

  • All data frames must be of class data.frame (or a subclass like data.table) and not be empty.

  • All required columns must be present and no additional columns are allowed.

  • Columns must have the correct names and data types as specified in the respective data specifications.

  • No duplicated rows are allowed.

Beyond these general rules, there are specific validation checks for each type of data frame. We break them down by data type in the sections below.

Vaccination schedule table

Efficacy estimates table

Routine immunization data

Birth seasonality data

Sample pair

  • Must be a named list without duplicate names.

  • All the names in the list must be part of the dose column names in ri_data.

  • All the values in the list must be part of the dose column names and birth column name in ri_data.

Vaccine immunity type

  • Must be a named list without duplicate names.

  • All the names in the list must be part of the vaccine names in vs_info$vaccine.