cts_events_extract: Extract CTS events data

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

Description

Extracts CTS movement records from the EPIC server, and organises it in the format required for the specified SimInf model.

Usage

1
cts_events_extract(uid = NULL, pwd = NULL, modeldata, outfile = NULL)

Arguments

uid

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

pwd

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

modeldata

A list containing the model data. The components labelled model, startdate and enddate are used in this function; for more details on how to specify the modeldata object, see the example at the end of this help file.

outfile

Name of file on local system where the output should be written to. If none is supplied, a default descriptive file name will be assigned.

Details

Only CTS movement records for which is_trans = 'f' and is_valid_history = 't' are included in the events data set. Records are returned for all of England, Wales and Scotland.

As the data extraction and formatting takes a considerable amount of computational time (~20 minutes for the data from a single year), the output can be saved on file for future use.

Value

Returns a data frame with events data (entries, exits, internal transfers, external transfers) as required by the SimInf simulation framework.

The saved output file can be used in the cts_prep function without needing to re-extract and format the CTS events data each time.

Note

Currently only formatting for the SIR model is implemented.

Author(s)

Theo Pepler

See Also

cts_prep

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## -- EXAMPLE NOT RUN --

## Initialise model object
# modeldata1 <- vector('list', 5)
# names(modeldata1) <- c('initdata', 'eventdata', 'model', 'startdate', 'enddate')
# modeldata1$model <- 'SIR'
# modeldata1$startdate <- '2012/01/01'
# modeldata1$enddate <- '2012/03/31'

## Extract CTS events data
# cts_events_extract(modeldata = modeldata1)

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