View source: R/13.0-bioenergetic-classes.R
| set_diet | R Documentation |
Updates the diet data component of a Bioenergetic object with new diet composition and prey energy information.
set_diet(
x,
diet_proportions,
prey_energies,
indigestible_prey = NULL,
normalize_diet = TRUE
)
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) |
The Bioenergetic object x with its diet_data
component updated (prey names, proportions, energies, and optionally
indigestible fractions), and fitted reset to FALSE.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.