csm_create_parameter: Create a cropping systems model (CSM) parameter variable

View source: R/csm_create_parameter.R

csm_create_parameterR Documentation

Create a cropping systems model (CSM) parameter variable

Description

Create a cropping systems model (CSM) parameter variable

Usage

csm_create_parameter(
  name,
  definition,
  units,
  lower_bound = NULL,
  upper_bound = NULL
)

Arguments

name

a length-one character vector name of a variable

definition

a length-one character vector that defines the CSM variable

units

a length-one character vector of the units of the CSM variable

lower_bound

a numerical value providing the lower bound for the parameter

upper_bound

a numerical value providing the upper bound for the parameter

Value

a list of csm_parameter objects

Examples

# Define Lotka-Voterra parameters with single call

lv_parameters <- csm_create_parameter(
  name = 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 Lotka-Volterra parameters with multiple calls

lv_parameters <-
  c(
    csm_create_parameter(
      name = "alpha",
      definition = "maximum prey per capita growth rate",
      units = "rabbits per rabbit"),
    csm_create_parameter(
      name = "beta",
      definition = "effect of predator population on prey death rate",
      units = "per fox"),
    csm_create_parameter(
      name = "gamma",
      definition = "predator per capita death rate",
      units = "foxes per fox"),
    csm_create_parameter(
      name = "delta",
      definition = "effect of prey population on predator growth rate",
      units = "foxes per rabbit"))


csmbuilder documentation built on Sept. 19, 2026, 1:06 a.m.