plot_techmix: Create a techmix chart in a ggplot object

Description Usage Arguments Examples

View source: R/plot_techmix.R

Description

The function returns a ggplot object containing a stacked bar chart showing a technology mix for different categories (portfolio, scenario, benchmark, etc.).

Usage

1
2
3
4
5
6
plot_techmix(
  data,
  metric_type_order = NULL,
  metric_type_labels = NULL,
  tech_colours = NULL
)

Arguments

data

Filtered input data, with columns: technology, metric_type, metric and value.

metric_type_order

Vector with the order of bars based on 'metric_type' values.

metric_type_labels

Vector with labels for bars. Order must follow that in 'metric type order'.

tech_colours

Dataframe containing colours per technology, with columns: technology, colour, label(optional).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data <- prepare_for_techmix_chart(
  process_input_data(example_data),
  sector_filter = "power",
  years_filter = c(2020, 2025),
  region_filter = "global",
  scenario_source_filter = "demo_2020",
  scenario_filter = "sds",
  value_to_plot = "technology_share"
)
print(
  plot_techmix(data)
)

2DegreesInvesting/r2dii.plot.static documentation built on Dec. 17, 2021, 6:37 a.m.