Learn R Programming

fb4package (version 2.0.0)

set_parameter_value: Set Parameter Value in Species Parameters

Description

Sets a specific parameter value in species parameter lists, automatically finding the correct category.

Usage

set_parameter_value(params, param, value)

Value

The params list with params[[category]][[param]]

replaced by value, where category is the first category in which param is found. Throws an error if param is not found in any category.

Arguments

params

Species parameters list

param

Parameter name to set

value

New parameter value

Examples

Run this code
sp <- list(consumption = list(CA = 0.303, CB = -0.275))
updated <- set_parameter_value(sp, "CA", 0.350)
updated$consumption$CA

Run the code above in your browser using DataLab