diff --git a/DESCRIPTION b/DESCRIPTION index 4b601cec..5bbf8f77 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: useeior Type: Package Title: USEEIO R modeling software -Version: 1.5.2 -Date: 2024-6-14 +Version: 1.5.3 +Date: 2024-7-13 Authors@R: c( person("Ben","Young", email="ben.young@erg.com", role="aut"), person("Jorge","Vendries", email="jvendries@gmail.com", role="aut"), diff --git a/R/BuildModel.R b/R/BuildModel.R index b2020ef2..d5693f59 100644 --- a/R/BuildModel.R +++ b/R/BuildModel.R @@ -229,6 +229,12 @@ createCfromFactorsandBflows <- function(factors,B_flows) { flows_inBnotC <- setdiff(B_flows, colnames(C)) C[, flows_inBnotC] <- 0 C[is.na(C)] <- 0 + + if("Greenhouse Gases" %in% factors$Indicator) { + # Make sure CO2e flows are characterized (see issue #281) + f <- B_flows[!(B_flows %in% factors$Flow) & grepl("kg CO2e", B_flows)] + C["Greenhouse Gases", f] <- 1 + } # Filter and resort model C flows and make it into a matrix C <- as.matrix(C[, B_flows]) return(C)