set_forcings | R Documentation |
Parameters which change their value over time are referred to as forcings. If and what parameters can vary over time depends on the model in question. In many cases, forcings represent time-series of environmental properties.
set_forcings(x, ...)
## S4 method for signature 'EffectScenario'
set_forcings(x, ...)
## S4 method for signature 'list'
set_forcings(x, ...)
x |
(vector of) scenario objects |
... |
named argument list to set as forcings |
Forcing time-series are always represented by a
data.frame
containing two columns. The first column representing time,
the second representing the parameter that is a function of time. The
ordering of columns is mandatory. The column names are essentially irrelevant
but may help documenting the scenario and its data. The rows must be
ordered chronologically. A time-series can consist of only a single row; in
this case it will represent constant conditions.
Handling forcing time-series is a costly task for the ODE solver due to consistency
checks and interpolation between timesteps. How the solver interpolates
the forcing time-series can be controlled by certain arguments to functions
such as simulate()
and effect()
. Please refer to simulate()
for a brief
overview and deSolve::forcings for a detailed description.
Forcing time-series should be kept as short as possible and as complex as needed for optimal computational efficiency.
Modified scenarios
# constant values will be automatically converted to a data.frame
Lemna_Schmitt() %>% set_forcings(temp=20) -> lemna
lemna@forcings
# setting multiple forcings at once
df <- data.frame(t=0:14, temp=rnorm(15, mean=20)) # random temperature series
Lemna_Schmitt() %>% set_forcings(temp=df, rad=15000) -> lemna
lemna@forcings
# forcings can also be supplied as a named list
Lemna_Schmitt() %>% set_forcings(list(temp=20, rad=15000)) -> lemna
lemna@forcings
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.