From a8db500d6ddee84d010bf0226962223886cf41ad Mon Sep 17 00:00:00 2001 From: WesIngwersen Date: Tue, 6 Aug 2024 17:15:58 -0400 Subject: [PATCH] Temporarily remove from public api these functions which will not work with models with external import factors: calculateMarginSectorImpacts(), calculateFlowContributiontoImpact(), and disaggregateTotalToDirectAndTier1() --- NAMESPACE | 3 --- R/CalculationFunctions.R | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 26c06aad..24b89f83 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,11 +8,8 @@ export(buildIOModel) export(buildModel) export(buildTwoRegionModels) export(calculateEEIOModel) -export(calculateFlowContributiontoImpact) -export(calculateMarginSectorImpacts) export(calculateSectorPurchasedbySectorSourcedImpact) export(compareFlowTotals) -export(disaggregateTotalToDirectAndTier1) export(extractAndFormatDemandVector) export(formatDemandVector) export(generateModelIdentifier) diff --git a/R/CalculationFunctions.R b/R/CalculationFunctions.R index 5ca57ce4..e6c59ffb 100644 --- a/R/CalculationFunctions.R +++ b/R/CalculationFunctions.R @@ -395,7 +395,7 @@ calculateSectorContributiontoImpact <- function (model, sector, indicator, domes #' @param indicator, str, index of a model indicator for use in the C matrix, e.g. "Acidification Potential". #' @param domestic, boolean, sets model to use domestic flow matrix. Default is FALSE. #' @return A dataframe sorted by contribution (high-to-low), also showing "M", "C", "impact". -#' @export +## @export ##temporarily comment out due to failure for models with external import factors calculateFlowContributiontoImpact <- function (model, sector, indicator, domestic=FALSE) { M <- model$M C <- model$C @@ -466,7 +466,7 @@ calculateSectorPurchasedbySectorSourcedImpact <- function (y, model, indicator) #' Calculate sector margin impacts in the form of M and N Matrix #' @param model A complete EEIO model: a list with USEEIO model components and attributes. #' @return A list with M_margin and N_margin -#' @export +## @export ##temporarily comment out due to failure for models with external import factors calculateMarginSectorImpacts <- function(model) { if (model$specs$IODataSource == "stateior") { stop("Margins not available for two-region models") @@ -550,8 +550,8 @@ calculateHouseholdEmissions <- function(model, f, location, characterized=FALSE) #' @param impact str, a model indicator (e.g., "Greenhouse Gases") row index of N, #' or elementary flow (e.g., "Methane/emission/air/kg") index of M #' @param opt_impact str {'indicator', 'elemflow'}, string code to specify impact type -#' @export #' @return A data frame of direct and per-tier-1-purchase sector impacts +## @export ##temporarily comment out due to failure for models with external import factors disaggregateTotalToDirectAndTier1 <- function(model, impact, opt_impact="indicator") { mtx_direct <- c("indicator"="D", "elemflow"="B")[opt_impact] if (is.na(mtx_direct)) {