cts_events_extract | R Documentation |
Extracts CTS movement records from the EPIC server, and organises it in the format required for the specified SimInf model.
cts_events_extract(uid = NULL, pwd = NULL, modeldata, outfile = NULL)
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 |
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. |
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.
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.
Currently only formatting for the SIR model is implemented.
Theo Pepler
cts_prep
## -- 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.