opts_list {EpiNow2} | R Documentation |
Return an _opts List per Region
Description
Define a list of
_opts()
to pass to regional_epinow()
_opts()
accepting
arguments. This is useful when different settings are needed between regions
within a single regional_epinow()
call. Using opts_list()
the defaults
can be applied to all regions present with an override passed to regions as
necessary (either within opts_list()
or externally).
Usage
opts_list(opts, reported_cases, ...)
Arguments
opts |
An |
reported_cases |
A data frame containing a |
... |
Optional override for region defaults. See the examples for use case. |
Value
A named list of options per region which can be passed to the _opt
accepting arguments of regional_epinow
.
See Also
Examples
# uses example case vector
cases <- example_confirmed[1:40]
cases <- data.table::rbindlist(list(
data.table::copy(cases)[, region := "testland"],
cases[, region := "realland"]
))
# default settings
opts_list(rt_opts(), cases)
# add a weekly random walk in realland
opts_list(rt_opts(), cases, realland = rt_opts(rw = 7))
# add a weekly random walk externally
rt <- opts_list(rt_opts(), cases)
rt$realland$rw <- 7
rt
[Package EpiNow2 version 1.5.2 Index]