R/nr_final_demand_fbs.R

Defines functions nr_final_demand_fbs

#' nr_final_demand_fbs
#'
#' @param fulldata data to perform actions on
#' @param nutrient the nutrient
#'
#' @author Jan-Philipp Dietrich
nr_final_demand_fbs<-function(fulldata,nutrient="nr"){
    food<-as.magpie(unwrap(nr_use(fulldata,nutrient="dm_model"))[,,"food",])
    content<-collapseNames(readGDX(fulldata,"i51_attributes_products_isabelle", format="first_found")[,,nutrient])
    out<-food*content
    return(out)
}
pik-piam/nitrogen documentation built on Nov. 5, 2019, 12:48 a.m.