Skip to content

Commit

Permalink
ComDef: total investment (extraction + generation)
Browse files Browse the repository at this point in the history
  • Loading branch information
klau506 committed Nov 12, 2024
1 parent b5ea3d1 commit 08324f6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -3724,6 +3724,31 @@ get_resource_investment <- function(GCAM_version = "v7.0") {
}


#' get_total_investment
#'
#' Calculate investment of resource production + extraction.
#' @param GCAM_version Main GCAM compatible version: 'v7.0' (default), 'v7.1', or 'v6.0'.
#' @keywords internal investment process
#' @return `total_investment_clean` global variable
#' @importFrom magrittr %>%
#' @export
get_total_investment <- function(GCAM_version = "v7.0") {
total_investment_clean <- NULL

total_investment_clean <- rbind(
resource_investment_clean,
elec_investment_clean
) %>%
dplyr::group_by('scenario','region','year') %>%
dplyr::mutate(value = sum(value)) %>%
dplyr::ungroup() %>%
dplyr::mutate(var = 'Investment|Energy Supply') %>%
dplyr::select(dplyr::all_of(gcamreport::long_columns))

total_investment_clean <<- total_investment_clean
}


#########################################################################
# BIND TO TEMPLATE FUNCTIONS #
#########################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ elec_capacity_add_clean;get_elec_capacity_add;elec_capacity_add;;
elec_investment_clean;get_elec_investment;elec_capacity_add;;
transmission_invest_clean;get_transmission_invest;elec_capacity_add_clean;;
resource_investment_clean;get_resource_investment;;;resource production by tech and vintage,regional primary energy prices
total_investment_clean;get_total_investment;elec_investment_clean,resource_investment_clean;;
iron_steel_imports;get_iron_steel_imports;;;regional iron and steel sources
iron_steel_exports;get_iron_steel_exports;;;traded iron and steel
iron_steel_clean;get_iron_steel_clean;iron_steel_imports,iron_steel_exports;;
Expand Down

0 comments on commit 08324f6

Please sign in to comment.