Learn R Programming

fb4package (version 2.0.0)

assess_diet_quality: Assess nutritional quality of diet

Description

Assesses the nutritional quality of the diet based on energy density, macronutrient composition, and digestibility of prey items.

Usage

assess_diet_quality(diet_data, prey_energies, prey_digestibility = NULL)

Value

A named list whose elements depend on whether the diet is time-varying or static. Always present: mean_energy_density

(numeric, J/g), energy_density_sd (numeric), and

energy_density_range (numeric vector of length 2). For time-varying diets, daily_energy_density (numeric vector) is also included. When prey_digestibility is supplied, the list additionally contains mean_digestibility, digestibility_sd, and (for time-varying diets) daily_digestibility. A

diversity sub-list with mean_shannon and

shannon_sd (and daily_shannon for time-varying diets) is always appended.

Arguments

diet_data

Diet composition data from FB4 simulation

prey_energies

Energy densities of prey items

prey_digestibility

Digestibility coefficients of prey items

Examples

Run this code
diet  <- list(proportions = data.frame(Day = 1:5,
                                       Prey1 = c(0.6, 0.6, 0.7, 0.5, 0.5),
                                       Prey2 = c(0.4, 0.4, 0.3, 0.5, 0.5)))
prey_e <- data.frame(Day = 1:5, Prey1 = 5000, Prey2 = 4500)
assess_diet_quality(diet, prey_e)

Run the code above in your browser using DataLab