R/readLIMITS.R

Defines functions readLIMITS

readLIMITS <- function(subtype) {

  if (is.null(subtype)) stop("Please provide one of the following subtypes: 'activities' or 'emissions'")

  x <- as.data.frame(read_excel("LIMITS_sector_act_emi.xlsx", sheet=subtype))
    
  if (subtype == "activities") {
    x <- as.magpie(x, spatial=1, temporal=4)
  } else if (subtype == "emissions") {
    x <- as.magpie(x, spatial=1, temporal=5, datacol=6)
  }
 
  return(x)
}
pik-piam/mrremind documentation built on March 30, 2024, 3:37 a.m.