R/readGGDC10.R

Defines functions readGGDC10

Documented in readGGDC10

#' Read GGDC 10-Sector Database - https://www.rug.nl/ggdc/structuralchange/previous-sector-database/10-sector-2014
#' @author Renato Rodrigues
#' @examples
#'  \dontrun{
#' a <- readSource("GGDC10",convert=F)
#' }
#'
#' @importFrom readxl read_excel
#' @importFrom tidyr gather
#'

readGGDC10 <- function() {

  data <- suppressWarnings(read_xlsx(path = "ggdc10.xlsx", sheet = "dataset"))

  dataLong <- data[, -c(2, 3)] %>%
    gather("Sector", "Value", -c(1:3))

  x <- as.magpie(dataLong, spatial = 1, temporal = 3, datacol = 5)

  return(x)

}
pik-piam/mrremind documentation built on Sept. 26, 2024, 1:15 p.m.