View source: R/integrity.checks.R
integrity.checks | R Documentation |
Before any requested estimation routine is ran, integrity.checks()
is called
to ensure the data passed as arguments meet the proper format and can be
properly interpreted by subsequent functions.
integrity.checks(
epid,
GT,
t,
begin,
end,
date.first.obs,
time.step,
AR,
S0,
methods
)
epid |
Epidemic dataset, expecting incidence counts in a varity of possible formats (see |
GT |
Generation time distribution from |
t |
Vector of dates at which incidence was observed. |
begin |
Begin date for estimation. Can be an integer or a date (YYYY-mm-dd or YYYY/mm/dd). |
end |
End date for estimation. Can be an integer or a date (YYYY-mm-dd or YYYY/mm/dd). |
date.first.obs |
Optional date of first observation, if |
time.step |
Optional. If date of first observation is specified, number of day between each incidence observation. |
AR |
Attack rate as a percentage from total population. |
S0 |
Initial proportion of the population considered susceptible. |
methods |
Vector of methods to be used for R/R0/Rt estimation. Must be provided as |
For internal use. Called by all implemented estimation methods.
All integrity/class checks are handled by this core function. GT must be an
object of class R0.GT
, and epidemic curve along with time values are handled
here. If you plan on calling manually any other estimation function, make sure
data are provided with correct format.
The epidemic curve epid
may be provided as a vector. In that case, a vector
t
may be provided with the dates of observation. If t
is not numeric, an
attempt is made to convert to dates with as.Date()
. If t
is not provided,
dates are obtained from the names of incid, and if not available, index
values are used. Finally, one can provide an epidemic curve object generated by
the epitools package (see check.incid()
for more details).
A quick note on t
, begin
and end
: when a date vector is provided (t
),
it will be used instead of index values to establish a date-related incidence.
If no date vector is provided, then begin
and end
can still be forced to
numeric values. It then links to the corresponding index values for incidence
data. If a date vector is provided, begin
and end
can either be numeric
values or dates. If numeric, they will link to the correspondig index values
for incidence, and be afterward interpreted as the associated date. If date,
they will be directly associated to incidence data.
Basicly, if specified, begin
and end
must always have the same class.
A list with two components, begin
and end
.
Pierre-Yves Boelle, Thomas Obadia
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.