effect | R Documentation |
Derives the effect level due to toxicant exposure in the supplied scenarios. Either relative to a control scenario or derived directly from model endpoints, depending on model type. For scenarios with moving exposure windows, the maximum effect is returned.
effect(x, ...)
## S4 method for signature 'EffectScenario'
effect(x, factor = 1, max_only = TRUE, ep_only = FALSE, marginal_effect, ...)
## S4 method for signature 'ScenarioSequence'
effect(x, ...)
x |
a scenario objects |
... |
additional parameters passed on to |
factor |
optional numeric value which scales the exposure time-series |
max_only |
|
ep_only |
logical, if TRUE only effect endpoints are returned as a vector |
marginal_effect |
|
By default, only the maximum effect in all moving exposure windows will
be returned. If argument max_only=FALSE
is set, the returned table will
be converted to long-format and will contain effect levels for each
assessed exposure window.
Effects are calculated similarly to relative errors, i.e. the difference
between control and treatment scenarios is divided by the absolute value
of the control. Effects are usually in the interval [0,1]
, but values
larger than one or smaller than zero can occur. As a special case, if the
endpoint from the control scenario is zero, then the effect is either
zero, if also the treatment is zero
positive infinity, if the treatment is smaller than zero
negative infinity, if the treatment is greater than zero
As an example, a control scenario achieves a biomass of 1.0 and the treatment scenario achieves a biomass of 0.9, the effect will be equal to 0.1 or 10%. However, effects can take on any real value. If, for example, the biomass of the previously mentioned treatment scenario drops below zero, then an effect larger than 1.0 will be calculated If, instead, the biomass in the treatment scenario is greater than in the control, then the effect will be negative.
Start and end time of exposure windows can be disabled by setting ep_only=TRUE
.
Effect levels smaller than a certain threshold can be automatically set to
zero (0.0
) to avoid spurious effect levels introduced by numerical errors.
Set marginal_effect
to an adequate value less than 1%.
Calculations can be sped up by providing a data.frame
of pre-calculated
control scenarios for each assessed time window. As control scenarios are
by definition independent of any exposure multiplication factor, they can
be reused for repeated calculations, e.g. to derive effect profiles or
dose-response relationships.
a tibble
, by default containing scenarios, effect levels, and the
exposure window where the maximum effect level occurred. The number of columns
depends on the enabled effect endpoints and function arguments.
By default, the first column, named scenarios
, contains the original scenario
objects that were the basis of the calculation. For each effect endpoint, it
will be followed by one column with the maximum effect level and two columns
containing start and end time of the associated exposure window. If exposure
windows are disabled, the columns will just contain the start and end time of
the simulation. The effect level column will have the name of the effect
endpoint, start and end time will additionally have the suffixes .dat.start
and .dat.end
, respectively.
effect(EffectScenario)
: Default for all generic scenarios
effect(ScenarioSequence)
: For scenario sequences
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.