Skip to content

Commit

Permalink
Add prepareImportConsumptionDemand function
Browse files Browse the repository at this point in the history
  • Loading branch information
jvendries committed Nov 17, 2023
1 parent a720261 commit 7dfdeaa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions R/DemandFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ prepareConsumptionDemand <- function(model, location) {
return(y_c)
}

#' Prepares a demand vector representing Import consumption
#' @param model An EEIO model object with model specs and IO tables loaded
#' @param location, str of location code for demand vector
#' @return a named vector with demand
prepareImportConsumptionDemand <- function(model, location) {
if (model$specs$IODataSource == "stateior") {
#y_c <- prepare2RDemand(model, location, domestic = FALSE, demand_type = "Consumption")
stop("Consumption vector for import final demand not yet implemented.")
} else {
y_c <- sumforConsumption(model, model$ImportFinalDemand, location)
}
return(as.matrix(y_c))
}


#' Prepares a demand vector representing domestic consumption
#' @param model An EEIO model object with model specs and IO tables loaded
#' @param location, str of location code for demand vector
Expand Down

0 comments on commit 7dfdeaa

Please sign in to comment.