Checks if the dataframe is suitable (i.e., contains appropriate columns and data ranges), and if so converts it to a popim_vacc_activities object and returns this.

as_vacc_activities(df)

Arguments

df

dataframe to be converted to class popim_vacc_activities

Value

an object of class popim_vacc_activities

Details

The input dataframe has to have at least the columns region, year, age_first, age_last, coverage, doses and targeting. Any further columns are simply carried over into the popim_vacc_activities object.

See also

popim_vacc_activities() for details of the S3 class.

Author

Tini Garske

Examples

df <- data.frame(region = "UK", year = c(2000, 2002),
                 age_first = 0, age_last = 0,
                 coverage = 0.8, doses = NA,
                 targeting = "random")
vacc <- as_vacc_activities(df)