View source: R/csm_create_model.R
| csm_create_model | R Documentation |
Create a model definition for a Cropping System Model (CSM)
csm_create_model(state, ..., name = "model")
state |
a list vector containing CSM state
variables defined using |
... |
optional arguments of list vectors containing
CSM parameters defined using |
name |
a character string containing a name for the models |
a list which defines all components of a model including state variables, input variables, parameters, transformed variables and data structures.
# Define state variables
lv_state <- csm_create_state(
c("x", "y"),
definition = c("prey", "predator"),
units = c("rabbits per square km", "foxes per square km"),
expression(~alpha*x-beta*x*y, ~delta*x*y-gamma*y))
# Define parameters
lv_parameters <- csm_create_parameter(
c("alpha", "beta", "gamma", "delta"),
definition = c("maximum prey per capita growth rate",
"effect of predator population on prey death rate",
"predator per capita death rate",
"effect of prey population on predator growth rate"),
units = c("rabbits per rabbit", "per fox",
"foxes per fox", "foxes per rabbit"))
# Define model
lotka_volterra_model <-
csm_create_model(
state = lv_state,
parms = lv_parameters)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.