| Title: | Prepare data to be used by the EDGE-Buildings model |
|---|---|
| Description: | Prepare data to be used by the EDGE-Buildings model. |
| Authors: | Robin Hasse [aut, cre] (ORCID: <https://orcid.org/0000-0003-1818-3186>), Pascal Sauer [aut], Antoine Levesque [aut], Hagen Tockhorn [aut] |
| Maintainer: | Robin Hasse <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.15.7 |
| Built: | 2026-06-09 11:17:59 UTC |
| Source: | https://github.com/pik-piam/mredgebuildings |
Prepare data to be used by the EDGE-Buildings model.
Maintainer: Robin Hasse [email protected] (ORCID)
Authors:
Pascal Sauer [email protected]
Antoine Levesque
Hagen Tockhorn
Useful links:
Disaggregate regional energy demand per carrier by end use while meeting the end use shares in the aggregated region.
.disaggregate(subset, key).disaggregate(subset, key)
subset |
data frame for one period and aggregated region |
key |
named vector with specification of the subset group (not used) |
The function first tries to find a solution that satisfies both the regional carrier and the overall end use constraints. If there is no solution, another optimisation is run that tries to also minimise deviations from the end use quantities but removes them from the constraints.
Fills missing values in a time series dataset using interpolation for gaps between known values and growth-based extrapolation for extending the series. The function uses linear interpolation between known values and calculates appropriate growth rates for extrapolation based on available data points. For regions with 3+ data points, it fits a log-linear model, while for regions with 2 data points, it uses a simple growth rate calculation. For regions within the extGrowthFactors data frame, the growth rates are used.
.fillTimeseries(df, extGrowthFactors = NULL, periods = 1990:2025).fillTimeseries(df, extGrowthFactors = NULL, periods = 1990:2025)
df |
A data frame containing region, enduse, period, and value columns |
extGrowthFactors |
A data frame containing external growth factors |
periods |
Vector of time periods to include in the result (default: 1990:2025) |
A complete data frame with filled values for all region-enduse-period combinations
This function aggregates selected variables at a given categorical level and replaces them with a new summarized entry in the dataset.
aggToLevel(df, variables, level, newname)aggToLevel(df, variables, level, newname)
df |
A data frame containing the data to be aggregated. |
variables |
A character vector of variable names that should be aggregated. |
level |
A string specifying the column in |
newname |
A string specifying the name for the newly aggregated category. |
A data frame where the selected variables have been aggregated into
a single variable with the specified newname.
Calculates air conditioning ownership rates per household by combining data from household surveys, IEA, and Odyssee. Data sources are prioritized in the following order: Odyssee > IEA > household surveys. Returns all available historical data points without period harmonization.
calcACOwnershipRates()calcACOwnershipRates()
magpie object with all available historical data points per region
Hagen Tockhorn
This function fills AC ownership rates for all regions from 1990 to endOfHistory using global regression parameters (alpha, beta, gamma, delta) with region-specific GDP shifts. The GDP shift (gdppopShift) is calculated for each region to horizontally shift the global S-curve along the GDP axis so that it passes through the region's most recent historical data point. This calibrates the global curve to match available historical data while maintaining the same functional form across all regions.
calcACOwnershipRatesFilled(endOfHistory = 2025)calcACOwnershipRatesFilled(endOfHistory = 2025)
endOfHistory |
last period of historical data (default: 2025) |
The logistic formula used is:
Regions without historical data use the global curve as-is (gdppopShift = 0).
magpie object with filled AC ownership rates for all regions (1990-endOfHistory)
Hagen Tockhorn
This function estimates global regression parameters for air conditioner (AC) ownership rates using a logistic function with GDP per capita and cooling degree days (CDD) as predictors. The function fits a non-linear regression model to derive parameters for the AC penetration logistic curve.
calcACOwnershipRegression()calcACOwnershipRegression()
The regression model follows the logistic formula:
where:
is the intercept parameter that sets the lower boundary of AC ownership
is the interaction coefficient (negated from fitted model coefficient b)
is the CDD exponent parameter
is the GDP per capita exponent parameter
The function performs a two-stage estimation process:
Alpha is set exogenously based on a minimum ownership rate assumption
Linear regression on log-transformed data with fixed alpha to obtain starting values for nls()
Non-linear regression using nls() with alpha fixed, estimating only beta, gamma, and delta
magpie object with global regression parameters (alpha, beta, gamma, delta)
Hagen Tockhorn
BRG has extremely comprehensive (and extremely expensive) sales data. But one can recover total sales of boilers for space heating from the EHPA report.
calcBRG()calcBRG()
MagPIE object with total boiler sales in European countries
Robin Hasse
Join data from various sources to construct a consistent European building stock with a focus on floor space (million m2).
calcBuildingStock(subtype = c("residential", "commercial"), granularity = NULL)calcBuildingStock(subtype = c("residential", "commercial"), granularity = NULL)
subtype |
Character with subsector |
granularity |
character, name of BRICK granularity |
MAgPIE object with historic building stock
if the distribution of building types is missing, it is filled with the Europe-wide distribution. It might be worthwhile to map filling countries instead.
Robin Hasse
Final energy carrier prices including energy supply cost, transport and distribution cost(T&D) and taxes (without VAT). CO2 price component and VAT are added later depending on the scenario assumptions.
calcCarrierPrices()calcCarrierPrices()
Robin Hasse
Calculate historic construction flows
calcConstruction()calcConstruction()
Robin Hasse
floor-space specific construction cost
calcCostConstruction(granularity = NULL)calcCostConstruction(granularity = NULL)
granularity |
character, name of BRICK granularity |
Robin Hasse
Demolition cost
calcCostDemolition()calcCostDemolition()
Robin Hasse
floor-space specific renovation cost
calcCostRenovationBS(granularity = NULL)calcCostRenovationBS(granularity = NULL)
granularity |
character, name of BRICK granularity |
MagPIE object with floor-space specific renovation cost depending on the initial and final state of the building
Robin Hasse
floor-space specific renovation cost
calcCostRenovationHS(energyLadder = FALSE, granularity = NULL)calcCostRenovationHS(energyLadder = FALSE, granularity = NULL)
energyLadder |
logical, should the calculation include renovation transitions that are considered a decline on the energy ladder? |
granularity |
character, name of BRICK granularity |
MagPIE object with floor-space specific renovation cost depending on the initial and final state of the building
Robin Hasse
Get Population Density
calcDensity(endOfHistory = 2025)calcDensity(endOfHistory = 2025)
endOfHistory |
upper temporal boundary for historical data |
magpie object
Hagen Tockhorn
Discount rate including implicit discounting
calcDiscountRate(granularity = NULL)calcDiscountRate(granularity = NULL)
granularity |
character, name of BRICK granularity |
Robin Hasse
https://doi.org/10.1016/j.eneco.2011.07.010
Calculate the regression parameters for the projection of final (FE) to useful (UE) energy conversion projection for all combinations of energy enduses and carriers. The regression parameters correspond to an asymptotic regression model and encompass the parameters Asym, R0 and lrc. For electric space cooling, a bounded logistic function is used with parameters k and x0. All parameters are determined using a nonlinear least-squares regression.
calcEfficiencyRegression(gasBioEquality = TRUE)calcEfficiencyRegression(gasBioEquality = TRUE)
gasBioEquality |
Determines if natural gas and modern biomass share the same efficiencies |
This approach closely follows the model by De Stercke et al. which is mainly driven by GDP per Capita.
Hagen Tockhorn
De Stercke, S. (2014). Dynamics of Energy Systems: A Useful Perspective (Interim Report, p. 68). IIASA. http://pure.iiasa.ac.at/id/eprint/11254/1/IR-14-013.pdf
This function processes historical and scenario electricity demand data for Information and Communication Technology (ICT) and data centers (DC). The initial data comes from exogenous projections using the Digital Transformation Level (DGI) as the primary driver of demand, with IEA data serving as the historical baseline.
calcElecDemandICT(endOfHistory = 2025)calcElecDemandICT(endOfHistory = 2025)
endOfHistory |
upper temporal boundary for historical data |
The function processes multiple demand estimates:
Mean and medium estimate
Lower demand boundary (DGI elasticity from historical efficiency dominant phases)
Upper demand boundary (DGI elasticity from historical service dominant phases)
Data is downscaled from R5 to country-level using data center counts as weights, with exceptional fixed shares for China within Asia Pacific (73.28%) and for Europe's R12 sub-regions (WEU: 75%, EEU: 14%, FSU: 11%). Network demand is added using global network/DC ratios. Historical data (IEA Base) is separated and harmonized with SSP scenario projections.
A magpie object containing ICT electricity demand data calculated from DC demands across regions, time periods, and scenarios.
Hagen Tockhorn
Takes the historic final energy demand by carriers from IEA and disaggregates it into different end uses.
calcFEbyEUEC()calcFEbyEUEC()
The disaggregation is performed such that the aggregated carrier-specific FE values of the IEA IO regions are met as a minimum requirement. In an ideal case, the enduse-specific FE shares are met as well.
data.frame with historic energy demands
For now, existing disaggregated final energy data with respect to carriers and
enduses combined is replaced in the final output. However, since the Odyssee
data is largely underestimating the real IEA FE targets, these shall serve as
lower boundaries for the disaggregation.
Such feature has been implemented in toolDisaggregate but is not running
smoothly yet.
Hagen Tockhorn, Robin Hasse
Calculate Efficiencies of Final (FE) to Useful (UE) Energy Conversion for all combinations of Energy Carriers and Enduses. Missing data points within the time interval of the original data (PFUDB) are filled with estimates from a non-linear regression w.r.t. GDP per capita. The efficiency projections are based on a model by De Stercke et al. which is mainly driven by GDP per Capita. It describes an S-shaped curve approaching assumed efficiency levels. The parameters of that curve are derived by a regression with observations of IEA data.
calcFEUEefficiencies(gasBioEquality = TRUE)calcFEUEefficiencies(gasBioEquality = TRUE)
gasBioEquality |
Determines if natural gas and modern biomass share the same efficiencies |
Hagen Tockhorn
De Stercke, S. (2014). Dynamics of Energy Systems: A Useful Perspective (Interim Report, p. 68). IIASA. http://pure.iiasa.ac.at/id/eprint/11254/1/IR-14-013.pdf
Data for many European countries is taken from EEA, India from IEA and other countries from Daioglou et al 2012. The result does not cover all countries and has mixed points in time depending on the region.
calcFloorspacePast(endOfHistory = 2025)calcFloorspacePast(endOfHistory = 2025)
endOfHistory |
upper temporal boundary for historical data |
MAgPIE object with historic floor space
RH: In Antoine's EDGE-B, data points associated with an GDP/POP above 70000 USD/cap are dropped here to improve the later regression. This filtering should be moved to getFloorspaceResidential where the regression is performed. Therefore, the high-income data points are kept at this stage.
Robin Hasse, Antoine Levesque, Hagen Tockhorn
Residential floor space per capita
calcFloorspacePerCap(scenarios, granularity = NULL)calcFloorspacePerCap(scenarios, granularity = NULL)
scenarios |
A string (or vector of strings) designating the scenario(s) to be returned. |
granularity |
character, name of BRICK granularity |
MagPIE object with residential floor space per capita
Robin Hasse
Computes or loads annual heating and cooling degree days (HDDs and CDDs) for given socio-economic scenarios.
calcHDDCDD(scenario = "SSPs", fromSource = TRUE, endOfHistory = 2025)calcHDDCDD(scenario = "SSPs", fromSource = TRUE, endOfHistory = 2025)
scenario |
Character vector specifying the socio-economic scenario(s), e.g., |
fromSource |
Logical. If |
endOfHistory |
Integer. Upper temporal boundary for historical data.
If it deviates from 2025, |
A magclass object with annual degree-day values.
For fromSource = FALSE, the job requires a runtime of >24h and memory > 100G.
Hagen Tockhorn
Rough assumption based on online reference values scaled with U-values from Hotmaps and heating degree days (HDD).
calcHeatingCapacity(swissFormular = FALSE)calcHeatingCapacity(swissFormular = FALSE)
swissFormular |
boolean, apply the simplistic swiss formular? |
This is a very rough estimation that neglects regional differences and many other effects. It should be replace by bottom-up calculation based on climate data.
MagPIE object with floor-area specific heating capacity
Robin Hasse
https://www.heizung.de/ratgeber/diverses/heizleistung-berechnen-gruende-und-ablauf.html
The data is taken from the EU reference scenario technology assumptions. We map our technologies to the higher resolved PRIMES technologies. For missing commercial technologies, we assume residential values but decrease purchasing cost by 10%.
calcHeatingSystem( subtype = c("Purchasing cost", "Efficiency"), granularity = NULL )calcHeatingSystem( subtype = c("Purchasing cost", "Efficiency"), granularity = NULL )
subtype |
character, variable type (either 'Purchasing cost' or 'Efficiency') |
granularity |
character, name of BRICK granularity |
MagPIE object with capacity-specific purchasing cost or efficiency of heating systems
Robin Hasse
Calculate Matrix of heating system replacement shares
calcHeatingSystemReplacement()calcHeatingSystemReplacement()
MagPIE object with shares
Robin Hasse
We use national data from industry association for the biggest European countries and European data sets from the EHI and EHPA.
calcHeatingSystemSales()calcHeatingSystemSales()
MagPIE object with heating system sales
Robin Hasse
Number of persons per household.
calcHouseholdSize()calcHouseholdSize()
MAgPIE object with household size
THE EU Buildings Database gives one share of all dwellings with 5 or more persons. This share is weighted with 5 persons which can cause a downward bias.
Robin Hasse
IEA EEI final energy data is processed and mapped w.r.t. carrier and enduse names.
calcIEA_EEI(subtype = c("buildings"), mixData = FALSE)calcIEA_EEI(subtype = c("buildings"), mixData = FALSE)
subtype |
sector name |
mixData |
logical indicating whether to mix res/com data points if both are not given |
As for the buildings sector, data for residential and commercial ("service") buildings is aggregated and the carrier "biomass" is split into traditional and modern biomass w.r.t. to income per capita. Energy data on "space_cooling" is aggregated over all carriers into "elec".
data.frame containing enduse- and carrier-resoluted energy data
Hagen Tockhorn
Computes data for the Primary Final Useful (PFU) resolution
calcIEAPFU()calcIEAPFU()
IEA data as MAgPIE object aggregated to country level
Antoine Levesque, Robin Hasse
## Not run: a <- calcOutput("IEAPFU")## Not run: a <- calcOutput("IEAPFU")
Parameters for the lifetime of heating systems are taken from a very detailed EIA publication for building sector appliances and equipment. The range of the building shell lifetime is taken from Skarning et al. 2017.
calcLifetimeParams(subtype, granularity = NULL)calcLifetimeParams(subtype, granularity = NULL)
subtype |
character, type of asset (either 'building', 'heatingSystem' or 'buildingShell') |
granularity |
character, name of BRICK granularity |
MagPIE object with Weibull lifetime distribution parameters
Robin Hasse
https://www.eia.gov/analysis/studies/buildings/equipcosts/pdf/full.pdf
http://dx.doi.org/10.1016/j.enbuild.2017.01.080
Extrapolate the residential heating system distribution in each vintage from DEU to other countries and to commercial buildings.
calcLTRS(refGranularity = c("typ", "sec"))calcLTRS(refGranularity = c("typ", "sec"))
refGranularity |
character, for |
We use iterative proportional fitting to extrapolate the German residential pattern to other countries and subsectors. This data is extremely rough and should be taken with care. It is helpful in the matching nonetheless to represent interactions between vintage and heating systems while other more reliable references assure overall consistency.
MagPIE object
Robin Hasse
Calculate Reference data for input matching
calcMatchingReference(subtype)calcMatchingReference(subtype)
subtype |
character, matching reference |
Robin Hasse
Residential stock variables are given in number of dwellings, flats or houses while commercial stock is given in Floor space. This function computes all stock variables in terms of floor space considering dwelling size.
calcOdysseeStock(interpolate = FALSE)calcOdysseeStock(interpolate = FALSE)
interpolate |
logical, if TRUE, floor space growth rates from JRC_IDEES are used to inter- and extrapolate the data |
The data can be inter- and extrapolated using IDEES floor space data. As we trust the absolute level less than Odyssee, we only consider the growth to fill values.
MagPIE object with building stock data
Robin Hasse
PFU Data is disaggregated into different thermal and non-thermal Enduses using FE Shares from Odyssee and IEA_ETP.
calcPFUDB()calcPFUDB()
This was adapted from EDGE function 'getPFUDB.R'.
magpie object
Hagen Tockhorn, Robin Hasse
Population differentiated by location (urban/rural) and building type
calcPopulationBuildings(granularity = NULL)calcPopulationBuildings(granularity = NULL)
granularity |
character, name of BRICK granularity |
MagPIE object with population at BRICK granularity
Robin Hasse
The renovation depth is currently calculated based on the ratio of specific useful energy demand after and before the renovation. This is valid under the assumption that there is no change in behaviour (rebound effect) which we currently make. Once adaptive behaviour is considered, we should use the ratio of U-values.
calcRenDepth()calcRenDepth()
Robin Hasse
Combine data on heating system sales and replacement to derive full building state transition data
calcRenovation()calcRenovation()
MagPIE object with historic renovation flows
Robin Hasse
Specific renovation cost are estimated with a linear model with intercept w.r.t. to the renovation depth.
calcRenovationCostModel()calcRenovationCostModel()
The specific investment cost for renovation depending on the depth of renovation is calculated using a two-level statistical model fitted with data from a European Commission (EC) report on renovation. In a fist step, we fit a simple linear model with intercept to predict specific investment (USD/m2) with relative PE savings. In a second step, this linear model is scaled with one factor for each region. This scaling factor is predicted with GDP/POP using a negative exponential curve. For EU regions that are reported, we correct the result with a region-specific but time-invariant factor to best match the linear model to the data. This way, we get a linear model with intercept for each region that can be extrapolated to other regions (using GDP/POP) which still matches data of EU regions very well. The cost is finally disaggregated across residential building types (SFH, MFH) based on a rough cost factor seen in the ENTRANZE data.
MAgPIE object with specific renovation cost
Robin Hasse
https://op.europa.eu/s/xnYt
Calculates country surface
calcSurface()calcSurface()
Surface by country
Antoine Levesque
IEA's Tracking clean energy progress 2014
calcTCEP(subtype = "enduse")calcTCEP(subtype = "enduse")
subtype |
character, type of data |
Robin Hasse
Calculate useful energy demand for space heating in buildings
calcUEdemand(granularity = NULL)calcUEdemand(granularity = NULL)
granularity |
character, name of BRICK granularity |
Robin Hasse
Calculate U-value
calcUValue()calcUValue()
Robin Hasse
Estimates regional fit parameters for projecting building envelope U-values using mixed-effects regression. Combines data from Hotmaps, MessageIX Buildings, and EU Buildings Observatory to model thermal performance across regions based on climate indicators (HDD/CDD) and economic development (GDP per capita).
calcUvalueParameters(endOfHistory = 2025)calcUvalueParameters(endOfHistory = 2025)
endOfHistory |
Integer. The last year to consider as historical data (default: 2025) |
The function uses a linear mixed-effects model with the formula: log(U-value - minU) ~ HDD + CDD + log(gdppop + 1) + (interaction terms) + (1 | region) where the interaction terms are interactions between HDD/CDD and log(gdppop + 1), respectively, and (1 | region) denotes a region-specific offset.
This captures the relationship between U-values and:
Heating degree days (HDD)
Cooling degree days (CDD)
GDP per capita (gdppop)
Interaction terms: how climate effects vary with economic development
Regional random effects: region-specific deviations from global pattern
The function handles regional parameter estimation in two ways:
For regions with sufficient historical data points, parameters are directly estimated via mixed-effects regression (lmer)
For regions with insufficient data, the function:
Uses global fixed effects as a baseline
Calculates the difference between aggregated regional projections and their reference values
Applies empirical Bayes shrinkage to balance between global pattern and regional differences
Adjusts intercepts using these shrunken offsets to create region-specific parameters
The resulting parameters can be used to project future U-values based on climate and economic scenarios.
magpie object with regional fit parameters
Hagen Tockhorn
Simple estimate of total FE demand in different building types
calcWeightFeBuildings()calcWeightFeBuildings()
Should only be used as weights not actual demand. The disaggregation to building types is too simplistic.
Robin Hasse
Convert heating systems sales in Italy from Assotermica
convertAssotermica(x)convertAssotermica(x)
x |
MagPIE object with Assotermica data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert German heating system data from BDH
convertBDH(x)convertBDH(x)
x |
MagPIE object with BDH data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert heating systems sales in Austria from BMK
convertBMK(x)convertBMK(x)
x |
MagPIE object with BMK data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert data from Census Hub
convertCensusHub(x, subtype)convertCensusHub(x, subtype)
x |
raw data |
subtype |
Eurostat code of data set |
MAgPie object with converted data
Robin Hasse
Tidy data from Daioglou et al. 2012. Currently, only the specific floor space (m2/cap) is available from household data file. UN sources are dropped, if there is data from other sources for the same region. For the remaining data, if there is data from multiple UN Source for a region and period (i.e. different cities), the average of those sources is considered. This neglects the differences in population size of the cities. Selected data points are removed additionally.
convertDaioglou(x, subtype = "households.specific floor space")convertDaioglou(x, subtype = "households.specific floor space")
x |
MAgPIE object with data from Daioglou et al. #nolint |
subtype |
. |
clean MAgPIE object with unique data points
Robin Hasse, Antoine Levesque
Convert Weibull lifetime distribution parameters for buildings
convertDeetman2020(x, subtype)convertDeetman2020(x, subtype)
x |
MAgPIE object with data from Deetman et al. 2020 |
subtype |
character, building subsector (either 'residential' or 'commercial') |
Robin Hasse
Convert data from the Federal Statistical Office of Germany
convertDestatis(x, subtype)convertDestatis(x, subtype)
x |
MagaPie object |
subtype |
character, data code |
MagPIE object
Robin Hasse
Convert historic floor space data from the European Environment Agency.
convertEEAfloorspace(x)convertEEAfloorspace(x)
x |
MAgPIE object with floor space data |
floor national floor space in million m2
Robin Hasse
Convert EHI Heating Market Report
convertEHI(x)convertEHI(x)
x |
MagPIE object with raw data |
MagPIE object with country-level data
Robin Hasse
Correct heat pump sales data from EHPA
convertEHPA(x)convertEHPA(x)
x |
MagPIE object with EHPA data |
MagPIE object with ISO 3 country codes
Robin Hasse
We should consider prper extrapolation
convertEnergiforsk2016(x)convertEnergiforsk2016(x)
x |
MAgPIE object with original district heating prices |
Robin Hasse
Convert to common units.
convertEUBuildingsDB(x, subtype)convertEUBuildingsDB(x, subtype)
x |
MAgPIE object with data from EU Buildings Database |
subtype |
character |
clean MAgPIE object with
Robin Hasse
Each report of the Heat Pumps Barometer covers the two years before. There numerous cases, where reports contradict in overlapping values or there are huge jumps (probably due to changes in the accounting). This function creates smooth trajectories back-casting from the most recent data. If data overlaps, earlier data is scaled to match more recent data. In case of gaps, the trajectories are back-casted maintaining relative growth within each report. Growth rates between reports are interpolated. The Method yields mostly smooth trajectories always hitting the mos recent reported numbers.
convertEurObservER(x, subtype)convertEurObservER(x, subtype)
x |
raw data |
subtype |
Eurostat code of data set |
MAgPie object with converted data
Robin Hasse
Drop EU28 aggregate and rename regions to ISO3.
convertEuropeanCommissionRenovation(x)convertEuropeanCommissionRenovation(x)
x |
MAgPIE object with data from EC report |
clean MAgPIE object with data from EU Buildings Database
Robin Hasse
Convert buildings-related data from Eurostat.
convertEurostatBuildings(x, subtype)convertEurostatBuildings(x, subtype)
x |
raw data |
subtype |
Eurostat code of data set |
MAgPie object with converted data
Robin Hasse
Convert heating systems sales in Spain from FEGECA
convertFEGECA(x)convertFEGECA(x)
x |
MagPIE object with Assotermica data |
MagPIE object with ISO 3 country codes
Robin Hasse
Drop subnational data but keep other subgroups (i.e. rural/urban, income quartiles)
convertGDL(x, subtype)convertGDL(x, subtype)
x |
MAgPIE object with data from EU Buildings Database |
subtype |
. |
clean MAgPIE object with data from EU Buildings Database
Robin Hasse
The temporary data already is at EDGE-B regional resolution. It is uniformly disaggregated to country level here to comply with the madrat framework before it is aggregated to the identical resolution in fullEDGEBUILDINGS.
convertHDDCDDtemp(x)convertHDDCDDtemp(x)
x |
MAgPIE object with HDD and CDD data at EDGE-B resolution |
HDD CDD data at country resolution
Robin Hasse
convert Hotmaps
convertHotmaps(x)convertHotmaps(x)
x |
MagPIE object with raw building stock data |
MagPIE object with converted data
Robin Hasse
Convert household survey data on energy carrier use for cooking, lighting and appliances ownership rates
convertHouseholdSurveys(x, subtype)convertHouseholdSurveys(x, subtype)
x |
data.frame containing survey data |
subtype |
specifies data subset |
Hagen Tockhorn
https://hdl.handle.net/10419/301069
read energy carrier prices
convertIEA_OECD_Prices(x, subtype)convertIEA_OECD_Prices(x, subtype)
x |
MagPIE object |
subtype |
character, data set |
Robin Hasse
Convert Long Term Renovation Strategy
convertLTRS(x)convertLTRS(x)
x |
MagPIE object with data read from source |
MagPIE object
Robin Hasse
Convert data from MessageIX-Buildings
convertMessageIXBuildings(x, subtype)convertMessageIXBuildings(x, subtype)
x |
read-in data object |
subtype |
specifies data base category |
Rename regions and convert unit
convertOdyssee(x, subtype = "250109")convertOdyssee(x, subtype = "250109")
x |
MAgPIE object with data from Odyssee Database |
subtype |
dataset version |
clean MAgPIE object
Robin Hasse
This was adapted from EDGE function 'getPFUDB.R'.
convertPFUDB(x)convertPFUDB(x)
x |
MAgPIE object with data from PFUDB #nolint |
magpie object
Hagen Tockhorn
Converts PRISMA ICT data to ISO country codes and fills missing countries. Primarily used for data center count data.
convertPRISMA_ICT(x, subtype)convertPRISMA_ICT(x, subtype)
x |
MAgPIE object from readPRISMA_ICT |
subtype |
Character string specifying data type (same as in readPRISMA_ICT) |
A magpie object with converted country codes and filled countries
Hagen Tockhorn
Convert Pulsen survey on Swedish heat pump market
convertPulsen(x)convertPulsen(x)
x |
MagPIE object with data |
MagPIE object with corrected region
Robin Hasse
Convert building life time data from Sandberg et al. 2016
convertSandberg(x)convertSandberg(x)
x |
MagPie object |
MagPIE object with full region converage
Robin Hasse
Convert heating systems stock and sales in Poland from SPIUG
convertSPIUG(x)convertSPIUG(x)
x |
MagPIE object with PIUG data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert TCEP data base
convertTCEP(x, subtype = "enduse")convertTCEP(x, subtype = "enduse")
x |
MAgPIE object with data from TCEP #nolint |
subtype |
character, type of data |
magpie object
Hagen Tockhorn, Robin Hasse
Clean up UN data on household size and composition
convertUNHouseholds(x, subtype)convertUNHouseholds(x, subtype)
x |
MAgPIE object with data from EU Buildings Database |
subtype |
household variable |
clean MAgPIE object with
Robin Hasse
Convert heating systems sales in France from Uniclima
convertUniclima(x)convertUniclima(x)
x |
MagPIE object with PIUG data |
MagPIE object with ISO 3 country codes
Robin Hasse
Convert VHK data
convertVHK(x)convertVHK(x)
x |
MagPie object |
MagPIE object
Robin Hasse
Convert WEO enduse shares w.r.t. to global final energy demand
convertWEO(x)convertWEO(x)
x |
readWEO object |
Hagen Tockhorn
Replace dots by dashes
dot2Dash(x, rev = FALSE)dot2Dash(x, rev = FALSE)
x |
character vector |
rev |
logical, if TRUE, replace dashes by dots |
character vector with replaced symbols
Robin Hasse
Convert EUR in given year to internal unit
eur2usd(x = 1, year = 2020, iso3c = "DEU", ...)eur2usd(x = 1, year = 2020, iso3c = "DEU", ...)
x |
value in EUR |
year |
integer, reference year |
iso3c |
region |
... |
further arguments to GDPuc::convertSingle |
value in constant 2017 US$MER
Robin Hasse
Extrapolate missing values beyond existing periods
extrapolateMissingPeriods(chunk, key, slopeOfLast = 5)extrapolateMissingPeriods(chunk, key, slopeOfLast = 5)
chunk |
grouped data.frame |
key |
column holding values for extrapolation |
slopeOfLast |
number of values for boundary regression |
data.frame with extrapolated column key
Robin Hasse, Hagen Tockhorn
Compute complete input data set for BRICK
fullBRICK(rev = 0, granularity = NULL)fullBRICK(rev = 0, granularity = NULL)
rev |
data revision which should be used as input (positive numeric). |
granularity |
character, name of BRICK granularity |
Robin Hasse
Function that produces the complete ISO data set required for the EDGE - Buildings model.
fullEDGEBUILDINGS(rev = 0)fullEDGEBUILDINGS(rev = 0)
rev |
data revision which should be used as input (positive numeric). |
Antoine Levesque, Robin Hasse, Hagen Tockhorn
readSource,getCalculations,calcOutput
## Not run: fullEDGEBUILDINGS() ## End(Not run)## Not run: fullEDGEBUILDINGS() ## End(Not run)
Additional columns to join by that have different names can be give. The kind of joint can also be specified.
join_all( x, y, by = NULL, .direction = "left", exclude = "value", silent = TRUE, ... )join_all( x, y, by = NULL, .direction = "left", exclude = "value", silent = TRUE, ... )
x, y
|
A pair of data frames |
by |
character vector of columns to join by beyond the commonly named |
.direction |
type of dplyr join, 'left' by default |
exclude |
character vector with column names that should be excluded from the search for join columns |
silent |
boolean, whether to print type of joint the join columns |
... |
additional arguments passed to join function |
Robin Hasse
Read heating systems sales in Italy from Assotermica
readAssotermica(subtype = NULL)readAssotermica(subtype = NULL)
subtype |
Character, report to read. if NULL, the most recent report is used for every data point. |
magpie object
Robin Hasse
Read German heating system data from BDH
readBDH()readBDH()
MagPIE object with yearly sales of heating systems in Germany
Robin Hasse
Read buildings characteristics data from the Built Environment Analysis Model (BEAM^2)
readBEAM2()readBEAM2()
Hagen Tockhorn
Read heating systems sales in Austria from BMK
readBMK()readBMK()
MagPIE object with yearly sales of heating systems in Germany
Robin Hasse
The Census Hub of the European Statistical System provides census data from 2011 on population and housing of EU member states. 2021 census data is announced to be published there too.
typeVintage: number of dwellings of different construction periods and building types (single, two, multiple dwellings). Show data on: dwellings, location: nations, Topics: Type of building, Period of construction (select all) -> CSV (Separator: Comma)
readCensusHub(subtype)readCensusHub(subtype)
subtype |
census subset |
MAgPIE object with data
Robin Hasse
https://ec.europa.eu/CensusHub2/
Compilation of survey data. Quintile 0 stands for the entire population.
households: Global data on population, household size, floor space per capita (m2/cap), population density (cap/km2), GINI and household expenditures (PPP2005/cap). Sources are written into a dimension to allow later cleaning based on sources
shares: Final energy shares of end uses in buildings. Sources are dropped.
readDaioglou(subtype = "households.specific floor space")readDaioglou(subtype = "households.specific floor space")
subtype |
. |
Robin Hasse, Antoine Levesque
https://doi.org/10.1016/j.energy.2011.10.044
Read Weibull lifetime distribution parameters for buildings
readDeetman2020(subtype = "residential")readDeetman2020(subtype = "residential")
subtype |
character, building subsector (either 'residential' or 'commercial') |
MagPIE object with Weibull lifetime parameters for different world regions
Robin Hasse
https://doi.org/10.1016/j.jclepro.2019.118658
Read data from the Federal Statistical Office of Germany
readDestatis(subtype)readDestatis(subtype)
subtype |
character, data code
|
MagPIE object
Robin Hasse
Project data: European Climate and Energy Modelling Forum
readECEMF(subtype = "FEPrices")readECEMF(subtype = "FEPrices")
subtype |
character, type of data |
FEPrices: price components w/o VAT in EUR/MWh
Robin Hasse
Floor space for many European countries between 1990 and 2009 in thousand m2.
readEEAfloorspace()readEEAfloorspace()
magpie object with floor space
Robin Hasse
## Not run: a <- readSource(type = "EEAfloorspace")## Not run: a <- readSource(type = "EEAfloorspace")
Read EHI Heating Market Report
readEHI(subtype = NULL)readEHI(subtype = NULL)
subtype |
Character, report to read. if NULL, the most recent report is used for every data point. |
magpie object
Robin Hasse
This data was provided upon request. It is free for non-profit organisations but we are not allowed to share it.
readEHPA(subtype = "hpSales")readEHPA(subtype = "hpSales")
subtype |
character, type of data |
MagPIE object with HP sales data for EU member states
Robin Hasse
Read European district heating prices
readEnergiforsk2016()readEnergiforsk2016()
Robin Hasse
Compilation of various data sources from the European Commission. Because of the considereable size of this database, a subtype has to be provided. The subtype represents the category of items. It is possible to append selected variables for further filtering.
readEUBuildingsDB(subtype = "")readEUBuildingsDB(subtype = "")
subtype |
character |
magpie object
Robin Hasse
## Not run: a <- readSource(type = "EUBuildingsDB")## Not run: a <- readSource(type = "EUBuildingsDB")
PDF market reports on Renewables in Europe
readEurObservER(subtype)readEurObservER(subtype)
subtype |
. |
magpie object
I download the report and snip a png of the table. Then I extract the data with this online tool and save it as a tabular csv in the source folder. The Tool is not fully reliable. This function throws an error if values don't sum up. You then have to correct the csv file manually.
Robin Hasse
https://www.eurobserv-er.org/
This function reads data on renovation from a pdf file of an EC report from 2019 (Tables 2 - 13). There is no period dimension. The data represents averages between 2012 and 2016.
readEuropeanCommissionRenovation(subtype = "csv")readEuropeanCommissionRenovation(subtype = "csv")
subtype |
character, source to read from: |
MAgPIE object with renovation data
Robin Hasse
https://op.europa.eu/en/publication-detail/-/publication/97d6a4ca-5847-11ea-8b81-01aa75ed71a1
## Not run: a <- readSource(type = "EuropeanCommissionRenovation")## Not run: a <- readSource(type = "EuropeanCommissionRenovation")
Read various data sets from Eurostat that are used in the modelling of buildings
nrg_inf_hptc: Heat pumps - technical characteristics by technologies
nrg_d_hhq: Disaggregated final energy consumption in households
lfst_r_lfsd2hh: Number of households by degree of urbanisation (2006-2023)
ilc_hcmh02: Average size of dwelling by household type and degree of urbanisation (2012)
ilc_lvho31: Average size of dwelling by household composition and degree of urbanisation (2020, 2023)
cens_21dwbnr_r3: Dwellings by type of building, number of rooms or useful floor space (2021)
sts_cobp_a: Building permits (1992 - 2024)
ilc_lvhe02: Persons living in private households by heating system used in the dwelling, household composition and degree of urbanisation (2023)
ilc_lvhe04: Persons heating their dwelling with district heating by used energy source, household composition and degree of urbanisation (2023)
ilc_lvhe05: Persons heating their dwelling with other than district heating by used energy source, household composition and degree of urbanisation (2023)
hbs_car_t315: Household characteristics by degree of urbanisation (1988-2020)
ilc_lvho01: Distribution of population by degree of urbanisation, dwelling type and income group (2003 - 2024)
ilc_lvho03: Average number of rooms per person by tenure status and dwelling type (2003 - 2024)
readEurostatBuildings(subtype)readEurostatBuildings(subtype)
subtype |
Eurostat code of data set |
MAgPIE object with data
see https://ec.europa.eu/eurostat/web/energy/data/energy-balances for definitions of codes
Robin Hasse
Read heating systems sales in Spain from FEGECA
readFEGECA(subtype = NULL)readFEGECA(subtype = NULL)
subtype |
Character, report to read. if NULL, the most recent report is used for every data point. |
magpie object
Robin Hasse
Different databases each comprising the harmonised results of regional/national surveys. Available subtypes are
SHDI: Subnational Human development Database
AreaDatabase: Subnational development Indicators (low/medium income countries)
readGDL(subtype)readGDL(subtype)
subtype |
. |
magpie object
Robin Hasse
https://globaldatalab.org/
https://doi.org/10.1038/sdata.2019.38
https://globaldatalab.org/asset/286/Smits%20GDL%20Working% 20Paper%2016-101%20v360.pdf
## Not run: a <- readSource(type = "GDL")## Not run: a <- readSource(type = "GDL")
Read historical and projected degree-day data
readHDDCDD(subtype = "ssp2")readHDDCDD(subtype = "ssp2")
subtype |
specifies SSP scenarios (e.g. "ssp2" or "ssp1|ssp2") |
Hagen Tockhorn
Heating and cooling degree days calculated with mredgebuildings::calcHDDCDD.
Calculating this data currently requires manual help. We therefore read the
result as a source here. This becomes obsolete once the primary calculation
is stable.
readHDDCDDtemp()readHDDCDDtemp()
Robin Hasse
Consistent building stock of EU28 residential and commercial sector. The data presents a snapshot, I guess in 2016 but this is not clear to me yet.
readHotmaps()readHotmaps()
There are a few duplicate rows. Due to inconsistent values we average across duplicates.
Robin Hasse
Read household survey data on energy carrier use for cooking, lighting and appliances ownership rates
readHouseholdSurveys(subtype = c("cooking", "lighting", "appliances"))readHouseholdSurveys(subtype = c("cooking", "lighting", "appliances"))
subtype |
Character specifying end-use |
Hagen Tockhorn
https://hdl.handle.net/10419/301069
Read AC ownership rates per household from IEA Sources
readIEA_acOwnership()readIEA_acOwnership()
Hagen Tockhorn
The data is obtained from the 2021 IEA report "An Energy Sector Roadmap to Carbon Neutrality in China" from Figure 3.25
readIEA_China()readIEA_China()
Robin Hasse
Read IEA Global Weighted Average of Air Conditioning Efficiencies
readIEA_coolingEfficiencies()readIEA_coolingEfficiencies()
Hagen Tockhorn
read energy carrier prices
readIEA_OECD_Prices(subtype)readIEA_OECD_Prices(subtype)
subtype |
character, data set |
Robin Hasse
In the LTRS, EU member states have to describe their building stock. Unfortunately, this isn't standardised in any way so it is hard to make use of this data. So far, we only use data from two figures in the German LTRS.
readLTRS()readLTRS()
MagPIE object
Robin Hasse
Read data from MessageIX-Buildings
readMessageIXBuildings(subtype = "uvalue")readMessageIXBuildings(subtype = "uvalue")
subtype |
specifies data base category |
Copied from website: The Odyssee database contains detailed energy consumption by end-use and their drivers as well as energy efficiency and CO2-related indicators. Latest available data is provided by national representatives, such as energy agencies or statistical organization, from all EU countries as well as Norway, Serbia, Switzerland and the United Kingdom.
readOdyssee(subtype = "260305")readOdyssee(subtype = "260305")
subtype |
dataset version |
magpie object
To download new data, log into the website, select all items of all
levels and download the data as
CSV (1 observation = 1 row, delimeter: ","). If this exceeds the
download limit, download multiple files, e.g. by splitting along periods.
Variables are labels with the item code but full names can be found in the source data
Pascal Führlich, Robin Hasse
https://odyssee.enerdata.net/database/
This was adapted from EDGE function 'getPFUDB.R'.
readPFUDB()readPFUDB()
magpie object
Hagen Tockhorn
Reads ICT and data center electricity demand data from PRISMA project Excel file. Supports different regional resolutions and data center counts.
readPRISMA_ICT(subtype)readPRISMA_ICT(subtype)
subtype |
Character string specifying data type |
A magpie object containing the requested ICT/data center data
Hagen Tockhorn
Read Pulsen survey on Swedish heat pump market
readPulsen()readPulsen()
MagPIE object
Robin Hasse
https://skvp.se/skvpold/statistik/pulsen
Read building life time data from Sandberg et al. 2016
readSandberg()readSandberg()
MagPIE object with life time parameters of buildings
Robin Hasse
https://doi.org/10.1016/j.enbuild.2016.05.100
Read heating systems stock and sales in Poland from SPIUG
readSPIUG()readSPIUG()
magpie object
Robin Hasse
Read TCEP data base
readTCEP(subtype = "enduse")readTCEP(subtype = "enduse")
subtype |
character, type of data |
magpie object
Hagen Tockhorn, Robin Hasse
Compilation of indicators on household size and membership composition. The estimates are based on 814 unique data points from 172 countries or areas, representing approximately 97 per cent of the world’s population in 2019, collected between 1960 to 2018.
readUNHouseholds(subtype)readUNHouseholds(subtype)
subtype |
household variable |
magpie object
Robin Hasse
https://www.un.org/development/desa/pd/data/household-size-and-composition
## Not run: a <- readSource(type = "UNHouseholds")## Not run: a <- readSource(type = "UNHouseholds")
Read heating systems sales in France from Uniclima
readUniclima()readUniclima()
magpie object
Robin Hasse
multiple EU studies mostly on different categories of appliances
readVHK(subtype)readVHK(subtype)
subtype |
character, specifies study and the respective csv file to
read: |
MagPIE object
Robin Hasse
Read WEO enduse shares w.r.t. to global final energy demand
readWEO(subtype)readWEO(subtype)
subtype |
variable to define data subset ("Buildings", "Transport", "Industry") |
Hagen Tockhorn
Introduce refrigerators as appliances
toolAddThermal(df, mapping, fridgeShare, feOnly = TRUE, shareOf = NULL)toolAddThermal(df, mapping, fridgeShare, feOnly = TRUE, shareOf = NULL)
df |
data.frame |
mapping |
original EDGE-B region mapping |
fridgeShare |
regional shares of refrigerators |
feOnly |
are absolute values (TRUE) or shares (FALSE) considered? |
shareOf |
column name to calculate share of - must be given if feOnly = FALSE |
Hagen Tockhorn
Aggregate BRICK input data to lower granularity
toolAggregateBrick(x, granularity = NULL, weight = NULL)toolAggregateBrick(x, granularity = NULL, weight = NULL)
x |
MagPIE object at BRICK default resolution |
granularity |
character, name of BRICK granularity |
weight |
magPIE object with weights, if |
named list with aggregated value and weights
Robin Hasse
Extrapolate from data on selected technologies to all technologies required
toolCompleteRenFlows(x, from, to)toolCompleteRenFlows(x, from, to)
x |
MagPIE object, renovation flows to complete |
from |
MagPIE object with origin quantities |
to |
MagPIE object with destination quantities |
We assume that there is a high status quo probability that people just do identical replacement. If they don't, they chose the system with probabilities proportional to the general shares.
MagPIE object
Robin Hasse
This function expects a MAgPIE object with ISO country codes in the spatial dimension. It applies toolCountryFill but fills with the average across regions.
toolCountryFillAvg(x, ...)toolCountryFillAvg(x, ...)
x |
MAgPIE object with ISO country codes in the spatial dimension |
... |
arguments passed to toolCountryFill |
Robin Hasse
This function takes energy demand data that differentiates only by carrier and disaggregates it further such that all relevant combinations of carrier and end use are differentiated. It ensures that given end use shares (across all carriers) are met.
toolDisaggregate( data, enduseShares, outliers = NULL, exclude = NULL, dataDisagg = NULL, regionMapping = NULL, forceShares = NULL )toolDisaggregate( data, enduseShares, outliers = NULL, exclude = NULL, dataDisagg = NULL, regionMapping = NULL, forceShares = NULL )
data |
data.frame with energy demand data differentiated by carriers that is to be disaggregated |
enduseShares |
data.frame with end use shares that have to be met. These
shares might be given at aggregated regional resolution if
|
outliers |
list of regions where naive disaggregation estimate shall be used. |
exclude |
data.frame with the columns |
dataDisagg |
data.frame similar to |
regionMapping |
data.frame with the columns |
forceShares |
data frame with shares to enforce for carrier-enduse combinations with single year data points per region. |
The function essentially performs a quadratic optimisation. The constraints make sure that both the carrier quantities and the end use shares are met. This generally leaves infinite solutions (in problematic cases none). To get to one disaggregation, the deviation from a given distribution across all relevant combinations of carriers and end uses is minimised.
Hagen Tockhorn, Robin Hasse
Provides all mappings needed to aggregate BRICK input data to a lower granularity.
toolGetBrickMapping(granularity)toolGetBrickMapping(granularity)
granularity |
character, name of BRICK granularity |
named list of brick dimension aggregation mappings
Robin Hasse
Takes MAgPIE object with a variable dimension and a unit dimension, and converts the unit according to a unit conversion table.
toolUnitConversion(x, unitConversion, removeUnit = FALSE)toolUnitConversion(x, unitConversion, removeUnit = FALSE)
x |
MAgPIE object |
unitConversion |
data.frame with the columns from, to, factor |
removeUnit |
boolean remove unit after conversion for clean variable names |
Robin Hasse