-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add nitrogen fertilizer reporting for agmip
- Loading branch information
caviddhen
committed
Feb 27, 2024
1 parent
5dd26ae
commit fac4326
Showing
8 changed files
with
69 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Type: Package | ||
Package: magpie4 | ||
Title: MAgPIE outputs R package for MAgPIE version 4.x | ||
Version: 1.202.12 | ||
Date: 2024-02-26 | ||
Version: 1.202.13 | ||
Date: 2024-02-27 | ||
Authors@R: c( | ||
person("Benjamin Leon", "Bodirsky", , "[email protected]", role = c("aut", "cre")), | ||
person("Florian", "Humpenoeder", , "[email protected]", role = "aut"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#' @title reportFertilizerNitrogen | ||
#' @description Reports inorganic nitrogen application on crops | ||
#' | ||
#' @importFrom magpiesets reporthelper summationhelper | ||
#' @export | ||
#' | ||
#' @param gdx GDX file | ||
#' @param level level of output | ||
#' | ||
#' @author David M Chen | ||
#' @seealso | ||
#' \code{\link{NitrogenBudget}} | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' x <- reportFertilizerNitrogen(gdx) | ||
#' } | ||
#' | ||
reportFertilizerNitrogen <- function(gdx, level = "regglo") { | ||
|
||
budget <- NitrogenBudget(gdx, level = level, cropTypes = TRUE ) | ||
|
||
out <- collapseNames(budget[, , "fertilizer"]) | ||
|
||
out <- reporthelper(out, level_zero_name = "Resources|Nitrogen|Inorganic Fertilizer Application", partly = TRUE ) | ||
out <- summationhelper(out) | ||
getNames(out) <- paste0(getNames(out), "Mt Nr/yr") | ||
|
||
return(out) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.