From 1621d9ff6810d5b4720ef2c4eb0b1f4c7b17264c Mon Sep 17 00:00:00 2001 From: Ben Young Date: Thu, 23 May 2024 16:07:31 -0400 Subject: [PATCH] validate CommodityCPI based on `BaseIOSchema`, increase tolerance slightly --- R/IOFunctions.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/IOFunctions.R b/R/IOFunctions.R index 39a71954..8055572b 100644 --- a/R/IOFunctions.R +++ b/R/IOFunctions.R @@ -112,9 +112,9 @@ transformIndustryCPItoCommodityCPIforYear <- function(year, model) { # To avoid interruption in later calculations, they are forced to 100 CommodityCPI[CommodityCPI==0] <- 100 # Validation: check if IO year CommodityCPI is 100 - if (year==2012) { + if (year==model$specs$BaseIOSchema) { for (s in CommodityCPI) { - if (abs(100-s)>0.3) { + if (abs(100-s)>0.4) { stop("Error in CommodityCPI") } }