read_vacc_activities.Rd
Reads a list of vaccination activities from a .csv file, checks if
the data fulfils the requirements for a popim_vacc_activities
object, and if so returns this object.
read_vacc_activities(file)
object of class popim_vacc_activities
, a dataframe with
one row per vaccination activity, with columns year
,
age_first
, age_last
, coverage
, targeting
.
The requirements are that the data contain the columns region
,
year
, age_first
, age_last
, coverage
and targeting
, of
types character, integer, integer, integer, double, character,
respectively.
0 <= age_first <= age_last 0 <= coverage <= 1 targeting must be one of "random", "correlated", "targeted".
Column region
details the (geographical) region to which each
vaccination activity is to be administered.
Column year
details the year in which each vaccination activity
occurs.
Columns age_first
and age_last
give the age range targeted in
each vaccination activity.
Column coverage
gives the proportion of the target population
that will be vaccinated, while column doses
gives the absolute
number of doses used in the vaccination activity. For a given
population size (which is not recorded in the
popim_vacc_activities
object generated here), these can be
converted into each other, when both are given, they may be
inconsistent with each other once applied to a specific
popim_population
object. The consistency between these two colums
cannot be confirmed in without reference to a popim_population
object, but this function requires that at least one of these is
non-missing in each row.
The column targeting
defines how vaccine is allocated if there
is pre-existing immunity in the population: For "random" targeting
individuals are vaccinated irrespective of immunity status, so if
prior to the vaccination activity the proportion immune was x,
then a proportion x of the vaccine will be administered to already
vaccinated individuals and therefore be wasted.
For "correlated" targeting vaccine is administered first to those already immune before any susceptible individuals receive vaccine. This option models the case of unequal access to vaccination.
For "targeted" targeting, vaccine will be given first to as yet non-immune individuals. This is the most effective use of vaccine. It may be realistic in the case of multi-year campaigns targeting different areas within the geographical region specified.
popim_vacc_activities()
for details of the S3 class, and
utils::read.csv()
which handles the reading of the .csv
file.
filename <- system.file("extdata", "vacc_activities.csv", package = "popim")
vacc <- read_vacc_activities(filename)