Skip to content

Commit

Permalink
Adjusting estimation on rabbit feed use
Browse files Browse the repository at this point in the history
  • Loading branch information
ohinz998 committed Jan 22, 2025
1 parent e8b07b9 commit 35db208
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions R/08_2_use_feed.R
Original file line number Diff line number Diff line change
Expand Up @@ -365,16 +365,11 @@ feed_req[, `:=`(
cakes_f = ifelse(is.na(cakes_f), mean(cakes_f, na.rm = TRUE), cakes_f),
scavenging_f = ifelse(is.na(scavenging_f), mean(scavenging_f, na.rm = TRUE), scavenging_f))]
# This simple procedure assumes equal feed composition for
# Horses, Asses, Mules, Camels, Camelids, other
feed_req[item_code != 0 & !proc %in% c("Rabbits husbandry", "Rodents husbandry, other"),
# Horses, Asses, Mules, Camels, Camelids, other, "Rabbits husbandry", "Rodents husbandry, other"
feed_req[item_code != 0,
`:=`(animals = total * animals_f, crops = total * crops_f,
grass = total * grass_f, fodder = total * fodder_f, cakes = total * cakes_f,
scavenging = total * scavenging_f)]
# Rabbits and hares, Rodents, other
feed_req[item_code != 0 & proc %in% c("Rabbits husbandry", "Rodents husbandry, other"),
`:=`(animals = total * animals_f, crops = total * (crops_f + grass_f),
grass = 0, fodder = total * fodder_f, cakes = total * cakes_f,
scavenging = total * scavenging_f)]

# Kick factors again
feed_req[, `:=`(animals_f = NULL, crops_f = NULL, grass_f = NULL,
Expand Down

0 comments on commit 35db208

Please sign in to comment.