cphsizes_estimate: Estimate CPH sizes

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

Description

Estimates number of cattle per CPH ("CPH size") from CTS movement data extracted from the EPIC server.

Usage

1
cphsizes_estimate(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. Only the components labelled model and startdate 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

For the specified date, the number of cattle per CPH is estimated by counting all animals moved onto a CPH before the date, without any record indicating that they have been moved off of the CPH before the date. Only CTS movement records where is_valid_history = 't' are included in this calculation.

CPH size estimates are returned for all CPHs (in England, Wales and Scotland) for which the estimates are non-zero.

As the data extraction and calculation takes a considerable amount of computational time (~40 minutes), the output can be saved on file for future use.

Value

Returns a data frame with the location IDs (field location_id from the movements table in the CTS database), CPH numbers, and number of cattle at each CPH on the specified date.

Note

The saved output file can be used in the cts_prep function without needing to re-estimate the CPH sizes each time.

Author(s)

Theo Pepler

See Also

cts_prep

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## -- 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'

## Estimate CPH sizes
# cphsizes(modeldata = modeldata1)

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