Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
10c1e45
data summary rmarkdown created
peetmate Jul 1, 2024
908656d
exploration outputs updated
peetmate Jul 2, 2024
c0781db
adding exploration of sqfile
peetmate Jul 9, 2024
19c50ed
cleaned.sqlite added
peetmate Jul 10, 2024
e707a19
input mapping file created
peetmate Jul 11, 2024
bf9dcba
energy parameters object created
peetmate Jul 11, 2024
4d0a837
meta-data added
peetmate Jul 11, 2024
6aed489
input mappings updated to include improved descriptions and a "type" …
peetmate Jul 16, 2024
791dec6
Update ghg_emission.R
peetmate Sep 18, 2024
27585a7
adapt the output functions to the iCLEANED shiny app
ahmedjoubest Oct 9, 2024
5ab2af2
Merge branch 'cleaned_v0.6.0' into dev/ahmed/tags/v0.6.0
ahmedjoubest Oct 9, 2024
5b825f1
Merge pull request #26 from APPLITICS/dev/ahmed/tags/v0.6.0
peetmate Oct 14, 2024
9a86e34
Update ghg_emission.R
ahmedjoubest Oct 21, 2024
6325a47
Merge branch 'dev/ahmed/tags/v0.6.0' of https://github.com/ahmedjoube…
ahmedjoubest Oct 21, 2024
c807c4f
Merge pull request #27 from APPLITICS/dev/ahmed/tags/v0.6.0
peetmate Oct 23, 2024
f8e7dfc
Merge Master into cleaned_v0.6.0
ahmedjoubest Nov 19, 2024
bfa7e7e
Merge branch 'cleaned_dev_ps' into staging
ahmedjoubest Nov 19, 2024
5bf0fc5
Resolve Conflict
ahmedjoubest Nov 19, 2024
8a4eed3
Remove input_mappings.R causing compiling errors
ahmedjoubest Nov 19, 2024
ac9ddb7
Update nitrogen balance function to support missing fertilizer
ahmedjoubest Nov 25, 2024
e6f920f
Update merge output function to support missing Fertilizer
ahmedjoubest Nov 25, 2024
89711ad
update Description
ahmedjoubest Nov 25, 2024
db3fabe
Merge pull request #29 from CIAT/hotfix/fertilizer
M-Emmanuel Nov 26, 2024
02ae588
debug when fertilizer exists
ahmedjoubest Nov 28, 2024
f240c75
Merge pull request #30 from CIAT/debug/fertilizer-existing
M-Emmanuel Nov 28, 2024
6d94995
Update README.md
M-Emmanuel Nov 28, 2024
a662b69
Update README.md
M-Emmanuel Nov 28, 2024
d6aa556
Merge pull request #31 from CIAT/M-Emmanuel-patch-1
M-Emmanuel Nov 28, 2024
6d6a29d
Update README.md
M-Emmanuel Nov 28, 2024
28e116a
developing emissions loop
peetmate Dec 3, 2024
3fbfaff
Update README.md
M-Emmanuel Dec 4, 2024
ebf33fb
script to process v37 kenya data created
peetmate Dec 9, 2024
82fdbf5
further development, correct parameter objects in the inst/extdata used
peetmate Dec 11, 2024
6646a7e
== changed to %in% in feed_quality loop
peetmate Dec 12, 2024
7186a67
workflow development v0 completed
peetmate Dec 12, 2024
6fb5359
issue with filtering of feed_production resolved
peetmate Dec 12, 2024
24921e2
updates
peetmate Sep 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Imports:
utils,
rlang,
stringr,
ggplot2
ggplot2,
openxlsx
Suggests:
knitr,
rmarkdown,
Expand Down
598 changes: 340 additions & 258 deletions R/compare_scenario.R

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions R/feed_quality.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ feed_quality <- function(para) {

livestock_type_selected <- livestock_df[livestock_df$livetype_code == livestock, ]


for (season in 1:nrow(seasons)) {

feed_production <- unnest(para[["feed_items"]], cols = c(feed_type_name))
Expand All @@ -49,9 +48,7 @@ feed_quality <- function(para) {
feed_allocation <- list()

for (i in 1:length(feed_types)) {

feed_selected <- feed_production %>% dplyr::filter(feed_type_name %in%
feed_production$feed_type_name[i])
feed_selected <- feed_production %>% dplyr::filter(feed_type_name %in% feed_types[i])

#feed_item <- as.data.frame(feed_selected[["feed_items"]])

Expand All @@ -77,7 +74,7 @@ feed_quality <- function(para) {
seasons$season_name[season])

feed_item_selected <- feeding_seasons %>%
dplyr::filter(feed_item_code == feed_selected[["feed_item_code"]])
dplyr::filter(feed_item_code %in% feed_selected[["feed_item_code"]])

livestock_selected <- feed_item_selected[["livestock"]] %>%
as.data.frame() %>%
Expand Down Expand Up @@ -135,7 +132,7 @@ feed_quality <- function(para) {
feed_allocation_all[is.na(feed_allocation_all)] <- 0

# Bind and add into the season list
season_allocation[[season]] <- cbind(season_name = rep(feed_item_selected$season_name, times = nrow(feed_allocation_all)),
season_allocation[[season]] <- cbind(season_name = rep(feed_item_selected$season_name[1],times = nrow(feed_allocation_all)),
livestock_category_code = rep(livestock_selected$livetype_code, times = nrow(feed_allocation_all)),
livestock_category_name = rep(livestock_type_selected$livetype_desc, times = nrow(feed_allocation_all)),
feed_allocation_all)
Expand All @@ -155,4 +152,6 @@ feed_quality <- function(para) {
# Bind by rows
livestock_feed_allocation <- livestock_allocation %>% bind_rows()

return(livestock_feed_allocation)

}
2 changes: 1 addition & 1 deletion R/ghg_emission.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ghg_emission <- function(para, energy_required, ghg_ipcc_data, land_required, ni
#Computing methane enteric emission factor

ef <- ym1%>%
mutate(enteric_methane_emissions = (ge_intake*(ym/100)*no_days)/55.65) #equation 10.21
mutate(enteric_methane_emissions = ((ge_intake/no_days)*(ym/100)*no_days)/55.65) #equation 10.21

############################################################################################################################
#Computing methane emission from manure management T2
Expand Down
219 changes: 103 additions & 116 deletions R/merge_outputs.R

Large diffs are not rendered by default.

Loading