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():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 withpreprocess_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 withpreprocess_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 byimpute_missing_doses(). Missing values are permitted only in vaccine-dose columns.- live_births
[data.frame]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 tobirthargument inconfig_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 likedata.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
Must contain the columns specified in dummy_vs_info if
preprocessed = FALSEor prep_dummy_vs_info otherwise.Columns must conform to the rules specified in dummy_vs_info or prep_dummy_vs_info, depending on the value of
preprocessed.
Efficacy estimates table
Must contain the columns specified in efficacy_default if
preprocessed = FALSEor prep_dummy_efficacy otherwise.Columns must conform to the rules specified in efficacy_default or prep_dummy_efficacy, depending on the value of
preprocessed.
Routine immunization data
Columns name and specifications must conform to the rules specified in dummy_monthly_ri_data or dummy_yearly_ri_data depending on whether the data is monthly or yearly, which is determined by the
monthlyargument inconfig_pviem().
Birth seasonality data
Columns name and specifications must conform to the rules specified in dummy_birth_seasonality.