R/convertEurostat_EffortSharing.R

Defines functions convertEurostat_EffortSharing

Documented in convertEurostat_EffortSharing

#' Converts EU Effort Sharing targets and historical emissions
#'
#' @param x MAgPIE object to be converted
#' @param subtype data subtype. Either "target" or "emissions"
#' @return A MAgPIE object containing the EU Effort Sharing targets (%) or Effort Sharing historical emissions (MtCO2)
#' @author Renato Rodrigues
#' @examples
#'
#' \dontrun{ a <- convertEurostat_EffortSharing(x,subtype="target")
#' }
#'

convertEurostat_EffortSharing <- function(x,subtype) {
  # fill countries with no data
  x  <- toolCountryFill(x, fill = 0, verbosity = 2)
  # replace NAs with 0
  x[is.na(x)] <- 0
 return(x)
 }
pik-piam/mrremind documentation built on March 30, 2024, 3:37 a.m.