Description Usage Arguments Value Examples
Take the date/cadence output from a MySQL query and add appropriate 'year', 'month', 'week', or 'day' columns.
1 | Date2CadLabel(query_result = NULL)
|
query_result |
A data frame resulting from a MySQL incidence query. A cadence column should be added after the query, but before calling this function. |
query_result The same dataframe, but with added 'year', 'month', 'week', or 'day' columns appropriate to the incidence cadence.
1 2 3 4 5 6 7 8 9 10 11 | require(DICE)
myDB = OpenCon()
data_sources = dbReadTable(myDB, name="data_sources")
dbDisconnect(myDB)
query_result = get_disease_data()
query_result$date = as.Date(query_result$date)
# add auxilary columns to query_result
source_ind = match(query_result$source_key, data_sources$source_key)
query_result$cadence = data_sources$cadence[source_ind]
# add year, month, week, columns
query_result = Date2CadLabel(query_result=query_result)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.