Learn R Programming

fb4package (version 2.0.0)

set_diet: Set Diet Data for Bioenergetic Objects

Description

Updates the diet data component of a Bioenergetic object with new diet composition and prey energy information.

Usage

set_diet(
  x,
  diet_proportions,
  prey_energies,
  indigestible_prey = NULL,
  normalize_diet = TRUE
)

Value

The Bioenergetic object x with its diet_data

component updated (prey names, proportions, energies, and optionally indigestible fractions), and fitted reset to FALSE.

Arguments

x

Bioenergetic object

diet_proportions

Data frame with daily diet proportions

prey_energies

Data frame with daily prey energy densities

indigestible_prey

Data frame with indigestible proportions (optional)

normalize_diet

Logical, whether to normalize diet proportions to sum to 1 (default TRUE)

Examples

Run this code
# \donttest{
bio <- Bioenergetic(
  species_params = list(
    consumption = list(CEQ = 1, CA = 0.303, CB = -0.275, CQ = 0.06)
  ),
  species_info = list(common_name = "Example fish")
)
diet  <- data.frame(Day = 1:365, prey1 = 0.6, prey2 = 0.4)
energ <- data.frame(Day = 1:365, prey1 = 4000, prey2 = 2500)
bio   <- set_diet(bio, diet, energ)
# }

Run the code above in your browser using DataLab