prepare | R Documentation |
Prepare data for modelling with idbrm
Default method used when preparing data
prepare(data, ...) ## Default S3 method: prepare(data, model, ...)
data |
A dataframe to be used for modelling |
... |
Additional arguments passed to model specific prepare functions |
model |
Character string, model type to prepare to use. Supported options are "convolution". |
Sam Abbott
Sam Abbott
# define some example data library(data.table) dt <- data.table( region = "France", cases = seq(10, 500, by = 10), date = seq(as.Date("2020-10-01"), by = "days", length.out = 50) ) dt <- dt[, deaths := as.integer(shift(cases, 5) * 0.1)] dt <- dt[is.na(deaths), deaths := 0] dt <- prepare( dt, model = "convolution", location = "region", primary = "cases", secondary = "deaths", ) dt[]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.