A data frame containing dummy data for the vaccination schedule in fakeland country in its raw format, specifying when each vaccine dose should be administered.
Format
A data frame with 4 rows and 4 columns:
- vaccine
[character]Vaccine name (e.g., 'OPV', 'IPV').- dose_num
[numeric]Whole-number dose number (0, 1, 2, ...).- age
[numeric]Age at which the dose is given.- age_unit
[character]Unit of age: 'week', 'month', or 'year'.
Details
Schedule validation rules
Dose numbers must be:
consecutive starting from 0 or 1 for each vaccine (e.g., 0, 1, 2 or 1, 2, 3)
one digit numbers (0-9) assuming that vaccination schedules rarely have more than 9 doses per vaccine.
Ages should be non-decreasing with dose number
Age units should be one of 'week', 'month', or 'year' case-insensitive.
See Validation rules section in validate_vs_info() for more details on validation rules.
See also
prep_dummy_vs_info for preprocessed version,
preprocess_vs_info() for preprocessing function,
validate_vs_info() for validation function
Examples
# \donttest{
# View schedule
dummy_vs_info
#> vaccine dose_num age age_unit
#> 1 OPV 0 0 week
#> 2 OPV 1 6 week
#> 3 IPV 1 6 week
#> 4 IPV 2 6 month
# Validate the schedule
validate_vs_info(dummy_vs_info, preprocessed = FALSE)
# Check dose order
dummy_vs_info |>
dplyr::group_by(vaccine) |>
dplyr::arrange(dose_num) |>
dplyr::mutate(
age_days = dplyr::case_when(
age_unit == "week" ~ age * 7,
age_unit == "month" ~ age * 30.44,
age_unit == "year" ~ age * 365.25
),
age_ok = (age_days - dplyr::lag(age_days)) >= 0
)
#> # A tibble: 4 × 6
#> # Groups: vaccine [2]
#> vaccine dose_num age age_unit age_days age_ok
#> <chr> <dbl> <dbl> <chr> <dbl> <lgl>
#> 1 OPV 0 0 week 0 NA
#> 2 OPV 1 6 week 42 TRUE
#> 3 IPV 1 6 week 42 NA
#> 4 IPV 2 6 month 183. TRUE
# }