Description Usage Arguments Value Examples
This function is generally called by get.DICE.data
. After retrieving the data is is formatted for use by DICE
1 2 3 4 5 | get.mysql(mod_level = 2, fit_level = 3, mod_name = c(NAME_2 = "BR"),
fit_names = "all", start.date = as.Date("2010-01-01"),
end.date = as.Date("2010-12-31"), disease = "dengue",
sql_data_source = NULL, season = NULL, all_years_flag = T,
db_opts = list(DICE_db = "predsci", CDC_server = F), cad_clim = TRUE)
|
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, |
start.date |
A Date-class variable - start date of fitting period. Passing a NULL value causes the earliest available mydata to be returned. |
end.date |
A Date-class variable - end date of forecasting period. Passing a NULL value causes the latest available mydata to be returned. |
disease |
String - disease name. Options for modeling are: flu, dengue, yellow$\_$fever, ebola, zika, cholera, chik, plague. To graphically explore the data see: predsci.com/id$\_$data/. A full list of diseases in the DICE database can be found from an R-prompt by following one of the examples below. |
sql_data_source |
Describes the data source for the incidence data. Default is 'cdc' (for |
season |
An integer (year) specifying the season. When only one year is needed and/or start/end dates are not certain, season can be set. If !is.null(season), it overrides the start./end.date inputs. |
all_years_flag |
Logic flag indicating if all years of incidence should be returned in addition to the specified season/date-range. |
fit_name |
A character vector indicating which fit-regions to use. If |
mydata A list ILI, SH, School, and Census mydata for both the model- and fit-level region(s).
1 2 3 4 5 6 7 8 9 10 11 12 13 | require(DICE)
mydata = get.mysql(mod_level = 2, fit_level = 4, mod_name = c(NAME_2='BR'), start.date=as.Date("2010-01-01"), end.date=as.Date("2010-12-31"), disease="dengue", sql_data_source=1)
-- Data diseases and data_sources -------
Access the database and list all available diseases:
library(DICE)
myDB = OpenCon()
data_sources = dbReadTable(con=myDB, name="data_sources")
unique(data_sources$disease)
# then list all data sources
str(data_sources)
data_sources$source_abbv
dbDisconnect(myDB)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.