#' nr_bg_res
#'
#' @param fulldata data to perform actions on
#' @param nutrient the nutrient
#'
#' @author Jan-Philipp Dietrich
# belowground crop residues (roots etc)
nr_bg_res<-function(fulldata, nutrient="nr") {
if (nutrient=="dm"){
dm <- collapseNames(readGDX(fulldata, "ov_prod_res_bg_reg", format="first_found")[,,"level"])
out <- dm[,,-which(dimnames(dm)[[3]]=="pasture")]
} else if (nutrient=="nr") {
dm<-collapseNames(readGDX(fulldata, "ov_prod_res_bg_reg", format="first_found")[,,"level"])
nr<- readGDX(fulldata, "f51_nr_residue_bg", format="first_found")
out<-dm[,,-which(getNames(dm)=="pasture")]*nr[,,-which(getNames(nr)=="pasture")]
} else {stop("currently only values for nr and dm exist")}
return(out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.