Skip to content

Commit

Permalink
Use increasing_or_decreasing (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaFu authored Nov 29, 2023
1 parent 1583870 commit 35554d4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/plot_trajectory.R
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ order_trajectory <- function(data) {

technology_kind <- get_tech_kind(data)

if (technology_kind == "green") {
if (technology_kind == "increasing") {
data <- data %>%
rename(
value = "value_low",
Expand Down Expand Up @@ -308,9 +308,9 @@ get_ordered_scenarios <- function(data) {
}

get_tech_kind <- function(data) {
technology_kind <- r2dii.data::green_or_brown %>%
technology_kind <- r2dii.data::increasing_or_decreasing %>%
filter(.data$technology == unique(data$technology)) %>%
pull(.data$green_or_brown) %>%
pull(.data$increasing_or_decreasing) %>%
unique()

technology_kind
Expand All @@ -324,11 +324,11 @@ scenario_colour <- function(data) {
technology_kind <- get_tech_kind(data)

switch(technology_kind,
"green" = reverse_rows(tibble(
"increasing" = reverse_rows(tibble(
scenario = ordered_scenarios,
colour = scenario_colours$hex
)),
"brown" = tibble(
"decreasing" = tibble(
scenario = rev(ordered_scenarios),
colour = scenario_colours$hex
),
Expand Down Expand Up @@ -368,7 +368,7 @@ scenario <- function(data, center_y = FALSE) {

technology_kind <- get_tech_kind(data)

if (technology_kind == "green") {
if (technology_kind == "increasing") {
data_scenarios <- data %>%
filter(is_scenario(.data$metric))

Expand Down

0 comments on commit 35554d4

Please sign in to comment.