View source: R/05-body-composition.R
| update_body_composition | R Documentation |
Updates body composition as fish grows or changes condition Used during simulation loops - assumes pre-validated inputs
update_body_composition(
old_weight,
new_weight,
old_composition = NULL,
processed_composition_params
)
old_weight |
Previous weight (g) |
new_weight |
New weight (g) |
old_composition |
Previous composition (optional) |
processed_composition_params |
List with processed composition parameters |
A named list with the same 13 elements as
calculate_body_composition, describing the body composition
at new_weight. If old_composition is supplied, an additional
element changes is appended — a named list with five numeric
scalars: weight_change, water_change, protein_change,
fat_change, and energy_density_change (all in the same units
as the corresponding composition elements).
params <- list(water_fraction = 0.72, fat_energy = 36450,
protein_energy = 17990, max_fat_fraction = 0.30)
old <- calculate_body_composition(weight = 100,
processed_composition_params = params)
update_body_composition(old_weight = 100, new_weight = 110,
old_composition = old,
processed_composition_params = params)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.