Learn R Programming

cvasi (version 1.4.0)

set_init: Set initial state

Description

The initial state represents the starting values of a scenario's state variables when starting a simulation. A scenario's default initial state may be insufficient to get sensible results.

Usage

set_init(x, init)

# S4 method for vector set_init(x, init)

# S4 method for EffectScenario set_init(x, init)

Value

modified EffectScenario objects

Arguments

x

vector of EffectScenario objects

init

named numeric vector

Details

In theory, a scenarios's state variables can be renamed by modifying the names of the initial state vector. However, this is strongly discouraged as this will affect other routines such as effect() and epx() and may render results useless.

Examples

Run this code
# Set initial biomass to 1.0
metsulfuron %>% set_init(c(BM=1.0)) %>% simulate()

Run the code above in your browser using DataLab