
Calculate complete body composition (Mid-level - Main function)
Source:R/05-body-composition.R
calculate_body_composition.RdMain function that calculates all body composition components and energy density from weight and processed parameters
Value
A named list with 13 elements describing the body composition:
- total_weight
Numeric. Total wet weight (g), equal to
weight.- water_g
Numeric. Water content (g).
- protein_g
Numeric. Protein content (g), estimated from water via Breck (2014) regression.
- ash_g
Numeric. Ash content (g), estimated from water via Breck (2014) regression.
- fat_g
Numeric. Fat content (g), calculated by subtraction and bounded to
[0, max_fat_fraction * weight].- water_fraction
Numeric. Water as a fraction of total weight.
- protein_fraction
Numeric. Protein as a fraction of total weight.
- ash_fraction
Numeric. Ash as a fraction of total weight.
- fat_fraction
Numeric. Fat as a fraction of total weight.
- energy_density
Numeric. Energy density (J/g wet weight).
- total_energy
Numeric. Total body energy (J).
- total_fraction
Numeric. Sum of all four fractions; should be close to 1.
- balanced
Logical.
TRUEiftotal_fractionis within 0.05 of 1.
Returns create_empty_composition() when weight <= 0.
Examples
params <- list(water_fraction = 0.72, fat_energy = 36450,
protein_energy = 17990, max_fat_fraction = 0.30)
calculate_body_composition(weight = 100,
processed_composition_params = params)
#> $total_weight
#> [1] 100
#>
#> $water_g
#> [1] 72
#>
#> $protein_g
#> [1] 15.48219
#>
#> $ash_g
#> [1] 1.787121
#>
#> $fat_g
#> [1] 10.73069
#>
#> $water_fraction
#> [1] 0.72
#>
#> $protein_fraction
#> [1] 0.1548219
#>
#> $ash_fraction
#> [1] 0.01787121
#>
#> $fat_fraction
#> [1] 0.1073069
#>
#> $energy_density
#> [1] 6696.582
#>
#> $total_energy
#> [1] 669658.2
#>
#> $total_fraction
#> [1] 1
#>
#> $balanced
#> [1] TRUE
#>