diff --git a/.buildlibrary b/.buildlibrary index ff7b0455..eeafa35a 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '32781942' +ValidationKey: '32906160' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/CITATION.cff b/CITATION.cff index 28a1fd6d..b50642e6 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'mrremind: MadRat REMIND Input Data Package' -version: 0.167.4 -date-released: '2023-08-14' +version: 0.168.0 +date-released: '2023-08-18' abstract: The mrremind packages contains data preprocessing for the REMIND model. authors: - family-names: Baumstark diff --git a/DESCRIPTION b/DESCRIPTION index f3c933ec..ff997fe1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrremind Title: MadRat REMIND Input Data Package -Version: 0.167.4 -Date: 2023-08-14 +Version: 0.168.0 +Date: 2023-08-18 Authors@R: c( person("Lavinia", "Baumstark", , "lavinia@pik-potsdam.de", role = c("aut", "cre")), person("Renato", "Rodrigues", role = "aut"), diff --git a/NAMESPACE b/NAMESPACE index 1016649c..b65bcf15 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,6 +10,7 @@ export(calcEDGAR7Fgases) export(calcEEAGHGProjections) export(calcEmber) export(calcEmissionFactorsFeedstocks) +export(calcFloorspace) export(calcHRE) export(calcIEA_ETP) export(calcIEA_EVOutlook) diff --git a/R/calcFloorspace.R b/R/calcFloorspace.R index 4e5ef43a..c3fa75c0 100644 --- a/R/calcFloorspace.R +++ b/R/calcFloorspace.R @@ -1,8 +1,26 @@ +#' Floor space in buildings +#' +#' Residential, commercial and total floor space from EDGE-B. Set +#' +#' @author Antoine Levesque, Robin Hasse +#' +#' @param onlyTotal boolean, only give total instead of sub-sectoral floor space +#' @return MAgPIE object with buildings floor space +#' +#' @importFrom madrat readSource +#' @importFrom magclass collapseNames +#' @export +#' +calcFloorspace <- function(onlyTotal = FALSE) { -calcFloorspace <- function() { - - data <- readSource("EDGE", subtype = "Floorspace") - data <- collapseNames(data[,,"buildings"]) - - return(list(x=data,weight=NULL, unit = "million m2", description = "Buildings floorspace")) + data <- readSource("EDGE", subtype = "Floorspace") + + if (onlyTotal) { + data <- collapseNames(data[, , "buildings"]) + } + + return(list(x = data, + weight = NULL, + unit = "million m2", + description = "Buildings floor space")) } diff --git a/R/fullREMIND.R b/R/fullREMIND.R index 284dc02a..93f60457 100644 --- a/R/fullREMIND.R +++ b/R/fullREMIND.R @@ -52,7 +52,8 @@ fullREMIND <- function(rev = 0) { calcOutput("FEdemand", subtype = "ES", round = 6, file = "f29_esdemand.cs4r") calcOutput("ChemicalFeedstocksShare", round = 2, file = "p37_chemicals_feedstock_share.cs4r") calcOutput("EnergyEffPaths", round = 6, file = "f29_efficiency_growth.cs4r") - calcOutput("Floorspace", round = 6, file = "p36_floorspace_scen.cs4r") + calcOutput("Floorspace", onlyTotal = TRUE, round = 1, file = "p36_floorspace_scen.cs4r") + calcOutput("Floorspace", round = 1, file = "f36_floorspace_scen.cs4r") calcOutput("WeightNash", round = 6, file = "p80_eoWeights_fix.cs4r") calcOutput("IntertempElastSubst", round = 6, file = "pm_ies.cs4r") calcOutput("TimePref", round = 6, file = "p23_prtp.cs4r") diff --git a/README.md b/README.md index e5b93890..1fb56162 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MadRat REMIND Input Data Package -R package **mrremind**, version **0.167.4** +R package **mrremind**, version **0.168.0** [![CRAN status](https://www.r-pkg.org/badges/version/mrremind)](https://cran.r-project.org/package=mrremind) [![R build status](https://github.com/pik-piam/mrremind/workflows/check/badge.svg)](https://github.com/pik-piam/mrremind/actions) [![codecov](https://codecov.io/gh/pik-piam/mrremind/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrremind) [![r-universe](https://pik-piam.r-universe.dev/badges/mrremind)](https://pik-piam.r-universe.dev/builds) @@ -39,7 +39,7 @@ In case of questions / problems please contact Lavinia Baumstark . +Baumstark L, Rodrigues R, Levesque A, Oeser J, Bertram C, Mouratiadou I, Malik A, Schreyer F, Soergel B, Rottoli M, Mishra A, Dirnaichner A, Pehl M, Giannousakis A, Klein D, Strefler J, Feldhaus L, Brecha R, Rauner S, Dietrich J, Bi S, Benke F, Weigmann P, Richters O, Hasse R, Fuchs S, Mandaroux R (2023). _mrremind: MadRat REMIND Input Data Package_. R package version 0.168.0, . A BibTeX entry for LaTeX users is @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is title = {mrremind: MadRat REMIND Input Data Package}, author = {Lavinia Baumstark and Renato Rodrigues and Antoine Levesque and Julian Oeser and Christoph Bertram and Ioanna Mouratiadou and Aman Malik and Felix Schreyer and Bjoern Soergel and Marianna Rottoli and Abhijeet Mishra and Alois Dirnaichner and Michaja Pehl and Anastasis Giannousakis and David Klein and Jessica Strefler and Lukas Feldhaus and Regina Brecha and Sebastian Rauner and Jan Philipp Dietrich and Stephen Bi and Falk Benke and Pascal Weigmann and Oliver Richters and Robin Hasse and Sophie Fuchs and Rahel Mandaroux}, year = {2023}, - note = {R package version 0.167.4}, + note = {R package version 0.168.0}, url = {https://github.com/pik-piam/mrremind}, } ``` diff --git a/man/calcFloorspace.Rd b/man/calcFloorspace.Rd new file mode 100644 index 00000000..6b89b6dd --- /dev/null +++ b/man/calcFloorspace.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calcFloorspace.R +\name{calcFloorspace} +\alias{calcFloorspace} +\title{Floor space in buildings} +\usage{ +calcFloorspace(onlyTotal = FALSE) +} +\arguments{ +\item{onlyTotal}{boolean, only give total instead of sub-sectoral floor space} +} +\value{ +MAgPIE object with buildings floor space +} +\description{ +Residential, commercial and total floor space from EDGE-B. Set +} +\author{ +Antoine Levesque, Robin Hasse +}