cts_prep: Prepare CTS data for modelling with SimInf

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/cts_prep.R

Description

Reads in and prepares CTS data for modelling with the SimInf simulation framework.

Usage

1
cts_prep(uid = NULL, pwd = NULL, startdate, enddate, model = c("SIR"), cphsizes_file = NULL, initdata_file = NULL, events_file = NULL)

Arguments

uid

User ID for the EPIC server. If not specified in the function call, the user may be prompted to supply it if required.

pwd

Password for the EPIC server. If not specified in the function call, the user may be prompted to supply it if required.

startdate

Date for the start of the simulation model; specify in the format 'YYYY/MM/DD'.

enddate

Date for the end of the simulation model; specify in the format 'YYYY/MM/DD'.

model

Compartmental model type; currently only 'SIR' is implemented.

cphsizes_file

Name of file containing CPH size data (i.e. numbers of animals per CPH on the start date of the simulation model) on the local file system, if available. Ignored if inidata_file is given. If both cphsizes_file and initdata_file are NULL, the required data will be extracted from the cts201404 databased on the EPIC server.

initdata_file

Name of the file on the local file system containing the formatted initialisation data. If NULL, the cphsizes_file (if available) will be used to construct the initialisation data set.

events_file

Name of the file on the local file system containing the formatted events data. If NULL, the required data will be extracted from the EPIC server.

Details

Initialisation and events data can be imported from files on the local file system, or extracted directly from the EPIC server. However, data extraction from the EPIC server takes considerably longer.

If data extraction from the EPIC server is necessary (in the case where either initdata_file and/or events_file are NULL), the user will be prompted to supply their user ID and password to access the EPIC server.

Value

Returns a model data object (list) containing the following components:

initdata

Initialisation data (number of animals at each location at the start of the simulation).

eventdata

Observed event data to be used in the simulation model.

model

Compartment model type.

startdate

Start date for the simulation model.

enddate

End date for the simulation model.

Note

Currently data preparation procedures are implemented for only the SIR model.

Author(s)

Theo Pepler

See Also

cphsizes_estimate, cts_events_extract

Examples

1
2
3
4
## -- EXAMPLE NOT RUN --

## Extract and prepare CTS data from the EPIC server
# cts_prep(startdate = '2012/01/01', enddate = '2012/03/31', model = 'SIR')

tpepler/EPIC.SimInf documentation built on July 29, 2021, 4:11 p.m.