R/reportTimberDemand.R

Defines functions reportTimberDemand

Documented in reportTimberDemand

#' @title reportTimberDemand
#' @description reports MAgPIE demand for timber.
#' 
#' @export
#' 
#' @param gdx GDX file
#' @return Timber demand
#' @author Abhijeet Mishra
#' @examples
#' 
#'   \dontrun{
#'     x <- reportTimberDemand(gdx)
#'   }
#' 

reportTimberDemand<-function(gdx){
  a <- NULL
  
  if(suppressWarnings(!is.null(readGDX(gdx,"fcostsALL")))){
    a <- TimberDemand(gdx,level = "regglo")
    a <- mbind(setNames(dimSums(a,dim=3),"Roundwood"),a)
    getNames(a) <- paste0("Timber demand|",getNames(a))
    getNames(a) <- paste0(getNames(a)," (mio tDM)")
  } else {message("Disabled (no timber) ", appendLF = FALSE)}
  
  return(a)
}
pik-piam/magpie4 documentation built on April 27, 2024, 2:12 p.m.