Description Usage Arguments Examples
View source: R/plot_trajectory.R
The function returns a ggplot object containing a stacked bar chart showing a technology mix for different categories (portfolio, scenario, benchmark, etc.).
1 2 3 4 5 6 | plot_trajectory(
data,
scenario_specs_good_to_bad,
main_line_metric,
additional_line_metrics = NULL
)
|
data |
Filtered input data; with columns: year, metric_type, metric and value. |
scenario_specs_good_to_bad |
Dataframe containing scenario specifications like name label, ordered from the most to least sustainable; with columns: scenario, label. |
main_line_metric |
Dataframe containing information about metric that should be plotted as the main line; with columns: metric, label. |
additional_line_metrics |
Dataframe containing information about additional metrics that should be plotted as lines; with columns: metric, label). |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | data <- prepare_for_trajectory_chart(
process_input_data(example_data),
sector_filter = "power",
technology_filter = "renewablescap",
region_filter = "global",
scenario_source_filter = "demo_2020",
value_name = "production"
)
scenario_specs <- dplyr::tibble(
scenario = c("sds", "sps", "cps"),
label = c("SDS", "STEPS", "CPS")
)
main_line_metric <- dplyr::tibble(metric = "projected", label = "Portfolio")
additional_line_metrics <- dplyr::tibble(
metric = "corporate_economy",
label = "Corporate Economy"
)
p <- plot_trajectory(data,
scenario_specs_good_to_bad = scenario_specs,
main_line_metric = main_line_metric
)
p
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.