cphsizes_estimate | R Documentation |
Estimates number of cattle per CPH ("CPH size") from CTS movement data extracted from the EPIC server.
cphsizes_estimate(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. Only 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. |
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.
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.
The saved output file can be used in the cts_prep
function without needing to re-estimate the CPH sizes each time.
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'
## Estimate CPH sizes
# cphsizes(modeldata = modeldata1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.