popim_vacc_activites object from a dataframeas_vacc_activities.RdChecks 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)an object of class popim_vacc_activities
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.
popim_vacc_activities() for details of the S3 class.
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)