Skip to content

Commit

Permalink
only add green technologies if not already present (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhoffa authored Mar 15, 2024
1 parent 94d302e commit 170d4b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/join_abcd_scenario.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ add_green_technologies_to_abcd <- function(data, scenario) {
unique() %>%
inner_join(increasing_techs, by = c("sector", "technology"))

increasing_techs_not_in_abcd <- dplyr::filter(
increasing_techs_in_scenario,
!(technology %in% unique(data$technology))
)

green_rows_to_add <- data %>%
group_by(
.data$name_company,
Expand All @@ -113,7 +118,7 @@ add_green_technologies_to_abcd <- function(data, scenario) {
) %>%
summarize() %>%
left_join(
increasing_techs_in_scenario,
increasing_techs_not_in_abcd,
by = "sector",
relationship = "many-to-many"
) %>%
Expand Down

0 comments on commit 170d4b0

Please sign in to comment.