R/reportPlantationEstablishment.R

Defines functions reportPlantationEstablishment

Documented in reportPlantationEstablishment

#' @title reportPlantationEstablishment
#' @description reports MAgPIE harvested area for timber.
#' 
#' @export
#' 
#' @param gdx GDX file
#' @return Area harvested for timber production
#' @author Abhijeet Mishra
#' @examples
#' 
#'   \dontrun{
#'     x <- reportPlantationEstablishment(gdx)
#'   }
#' 

reportPlantationEstablishment<-function(gdx){
  a <- NULL
  
  if(suppressWarnings(!is.null(readGDX(gdx,"fcostsALL")))){
    a <- PlantationEstablishment(gdx,level = "regglo") 
    getNames(a) <- paste0("Resources|Timber operations|Area Newly Established|",getNames(a))
    getNames(a) <- paste0(getNames(a)," (mha per yr)")
  } else {message("Disabled (no timber) ", appendLF = FALSE)}
  
  return(a)
}
pik-piam/magpie4 documentation built on May 7, 2024, 11:13 p.m.