get_disease_data: Retrieve Incidence and Climate Data

Description Usage Arguments Value Examples

View source: R/data_fxns.R

Description

This function retrieves incidence and climate data from the MySQL database. It is generally called by get.DICE.data.

Usage

1
2
3
4
get_disease_data(mod_level = 2, fit_level = 3, mod_name = c(NAME_2 =
  "BR"), years = "all", disease = "dengue", sql_data_source = integer(),
  daily_clim = FALSE, cad_clim = TRUE, mod_sum = FALSE,
  db_opts = list(DICE_db = "predsci", CDC_server = F))

Arguments

mod_level

An integer describing the spatial level of the model data.(Default value is 2) Levels: 0-Global, 1-Continent, 2-Country, 3-Region, 4-State, 5-County, 6-City. dice currently has mydata at levels 2-3 for CDC and 2-4 for GFT.

fit_level

An integer describing the spatial level of the fits used to construct the model-level profile/forecast (Default value is 3, must be >= mod_level).

mod_name

A named-vector of character strings that specify which region is to be modeled. In other words, mod_name specifies the country, region, state, etc. of the mod_level region. mod_name should be of the form mod_name = c(NAME_2='a', NAME_3='b',..., NAME_i='x' where i=mod_level and 'a', 'b',...,'x' are the appropriate level names. NAME_i='x' also accepts abbreviations. Choose appropriate names from diceData. For example, mod_name=c(NAME_2='United.States',NAME_3='Region4',NAME_4='North.Carolina') and mod_level=4 specifies North Carolina. To achieve the same result, use all abbreviations mod_name=c(NAME_2='US',NAME_3='R4',NAME_4='NC') or a mix of names and abbreviations mod_name=c(NAME_2='US',NAME_3='Region4',NAME_4='NC'). Unlike get.cdc.data(), get_disease_data() expects ISO2 country abbreviations.

years

An integer vector - all years to be included. If a value of "all" is passed, the function returns all available dates.

disease

A character string - for example 'flu' or 'dengue'

sql_data_source

An integer - designates which mydata source is to be used.

daily_clim

Logic value determining if daily climate data is retrieved. (Note: climate data averaged to the incidence-cadence is always returned.)

mod_sum

Logic value indicating if model data will be aggregated from fit data. If so, get_disease_data will not attempt to return model-level data.

Value

out A list with a lookup table 'attr' and then climate data organized by cadence, spatial patch, and then data_source.

Examples

1
2
require(DICE)
out = get_disease_data(mod_level = 2, fit_level = 4, mod_name = c(NAME_2='BR'), years="all", disease="dengue", sql_data_source=1)

predsci/DICE documentation built on Aug. 9, 2019, 9:41 a.m.