build_composition_df: Build a body-composition data frame from a list of...

View source: R/15.2-analysis-nutritional.R

build_composition_dfR Documentation

Build a body-composition data frame from a list of composition results

Description

Internal helper shared by analyze_composition_by_size() and analyze_composition_changes(). Converts a list of calculate_body_composition() outputs into a tidy data frame, avoiding duplication of the identical sapply + data.frame block.

Usage

build_composition_df(compositions, weights)

Arguments

compositions

List of results from calculate_body_composition(), one element per weight point or time step.

weights

Numeric vector of fish weights corresponding to each element.

Value

Data frame with columns Weight, Water_g, Protein_g, Ash_g, Fat_g, and the corresponding *_fraction and Energy_density columns.


fb4package documentation built on May 8, 2026, 1:07 a.m.