From 07998ce8b149cce58e9d6330798da11c6dc34ff8 Mon Sep 17 00:00:00 2001 From: Ben Young Date: Fri, 16 Aug 2024 11:50:58 -0400 Subject: [PATCH] avoid extra rows if location is set for single region model --- R/CalculationFunctions.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/CalculationFunctions.R b/R/CalculationFunctions.R index efe60522..ac5f46d8 100644 --- a/R/CalculationFunctions.R +++ b/R/CalculationFunctions.R @@ -559,6 +559,10 @@ calculateHouseholdEmissions <- function(model, f, location, characterized=FALSE) logging::logwarn("Household emissions not found in this model") return(NULL) } + if(length(model$specs$ModelRegionAcronyms) == 1) { + # Set location as NULL for single region model + location <- NULL + } codes <- model$FinalDemandMeta[model$FinalDemandMeta$Group%in%c("Household"), "Code_Loc"] if (!is.null(location)) { other_code <- codes[!grepl(location, codes)]