R/convertEmber.R

Defines functions convertEmber

Documented in convertEmber

#' Convert Ember data
#'
#' @md
#' @param x A [`magpie`][magclass::magclass] object returned from
#'          [`readHRE()`].
#'
#' @return A [`magpie`][magclass::magclass] object.
#'
#' @author Pascal Weigmann
#'
#'
#' @export

convertEmber <- function(x) {

  # add missing countries
  x <- toolCountryFill(x, fill = 0, verbosity = 2, no_remove_warning = "XKX")

  # replace NA by 0 to enable aggregation over incomplete regions
  x[is.na(x)] <- 0

  return(x)
}
pik-piam/mrremind documentation built on April 12, 2025, 12:02 a.m.