input_check: Functions to check input to epidemiar and set report settings...

Description Usage Arguments Value

View source: R/input_checks.R

Description

Function does basic existance checks and variety of logic checks on input data to run_epidemia(), and sets defaults to report_settings parameters.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
input_check(
  epi_data,
  env_data,
  env_ref_data,
  env_info,
  quo_casefield,
  quo_popfield,
  quo_groupfield,
  quo_obsfield,
  quo_valuefield,
  fc_model_family,
  raw_settings,
  groupings,
  env_variables
)

Arguments

epi_data

Epidemiological data with case numbers per week, with date field "obs_date".

env_data

Daily environmental data for the same groupfields and date range as the epidemiological data. It may contain extra data (other districts or date ranges). The data must be in long format (one row for each date and environmental variable combination), and must start at absolutel minimum report_settings$env_lag_length days (default 180) before epi_data for forecasting.

env_ref_data

Historical averages by week of year for environmental variables. Used in extended environmental data into the future for long forecast time, to calculate anomalies in early detection period, and to display on timeseries in reports.

env_info

Lookup table for environmental data - reference creation method (e.g. sum or mean), report labels, etc.

quo_casefield

Quosure of user given field containing the disease case counts.

quo_popfield

Quosure of user-given field containing population values.

quo_groupfield

Quosure of the user given geographic grouping field to run_epidemia().

quo_obsfield

Quosure of user given field name of the environmental data variables

quo_valuefield

Quosure of user given field name of the value of the environmental data variable observations.

fc_model_family

The family parameter passsed to mgcv::bam, and the extended families in family.mgcv can also be used. This sets the type of generalized additive model (GAM) to run: it specifies the distribution and link to use in model fitting. E.g. for a Poisson regression, the user would input "poisson()". If a cached model is being used, set the parameter to '"cached"'.

raw_settings

The report_settings object as given by the user.

groupings

List of all unique geographical groupings in epi_data.

env_variables

List of all unique environmental variables in env_data.

Value

Returns a list of items: a flag if there were any errors, plus accompanying error messages; a flag and messages for warnings; updated report_settings


EcoGRAPH/epidemiar documentation built on Nov. 13, 2020, 5:31 p.m.