get_tested_herds: Gets herds tested within an surveillance programme

View source: R/get_tested_herds.R

get_tested_herdsR Documentation

Gets herds tested within an surveillance programme

Description

Gets herds that have been sampled or tested within a surveillance programme for the selected years. You can choose between herds that have submitted samples or herds for which a certain number of samples have been examined for a specific disease.

Usage

get_tested_herds(
  eos_table,
  year = as.numeric(format(Sys.Date(), "%Y")) - 1,
  species = NULL,
  production = NULL,
  disease = NULL,
  min_prover = -1,
  tested = FALSE
)

Arguments

eos_table

[character(1)]
EOS table name.

year

[numeric]
One or more years that should be selected. Defaults to previous year.

species

[character]
The species that should be selected. Defaults to NULL.

production

[character]
The production type(s) for which number of tested samples should be calculated. Defaults to NULL.

disease

[character(1)]
The disease for which number of tested samples should be calculated. Defaults to NULL.

min_prover

[numeric(1)]
Minimum number of samples that should have been received or examined for the herd to be counted as sampled or tested. No check is performed if equal -1. Defaults to -1.

tested

[logical(1)]
If TRUE, the number of tested samples, If FALSE, the number of received samples. Defaults to FALSE.

Details

For programmes having several surveillance streams, it is possible to select surveillance streams based on species and production type. The species and/or production type must be written as in the eos-table. Be aware that species and production type may be missing and for production type it may often be wrong. Therefore, selection by production type and/or species may remove saker that you would want to keep. No selection is performed when the species or production type is missing from the eos-table.

It is possible to define a minimum requirement of number of samples received or tested. For programmes covering several infections, it is necessary to input the disease for which the samples should have been tested. The disease name must be given as it is written in the column name for the number of examined samples.

The eos_table name is the same name as the table name in the EOS data base.

Value

data.frame with tested or sampled locations.

Author(s)

Petter Hopp Petter.Hopp@vetinst.no


NorwegianVeterinaryInstitute/OKplan documentation built on Dec. 20, 2024, 10:41 a.m.