Learn R Programming

pacta.loanbook (version 0.1.0)

plot_trajectory: Create a trajectory plot

Description

Create a trajectory plot

Usage

plot_trajectory(data, center_y = FALSE, perc_y_scale = FALSE)

Value

An object of class "ggplot".

Arguments

data

A data frame like the outputs of prep_trajectory().

  • (Optional) If present, the column label is used for data labels.

center_y

Logical. Use TRUE to center the y-axis around start value (the default behavior of qplot_trajectory()), or use FALSE to not center.

perc_y_scale

Logical. FALSE defaults to using no label conversion. Use TRUE to convert labels on y-axis to percentage using scales::percent (the default behavior of qplot_trajectory()).

See Also

Other plotting functions: plot_emission_intensity(), plot_techmix(), prep_emission_intensity(), prep_techmix(), prep_trajectory(), qplot_emission_intensity(), qplot_techmix(), qplot_trajectory(), recode_metric_techmix(), recode_metric_trajectory(), scale_colour_r2dii(), scale_colour_r2dii_sector(), scale_colour_r2dii_tech(), scale_fill_r2dii(), scale_fill_r2dii_sector(), scale_fill_r2dii_tech(), spell_out_technology(), theme_2dii(), to_title()

Examples

Run this code
# plot with `qplot_trajectory()` parameters
data <- subset(
  market_share,
  sector == "power" &
    technology == "renewablescap" &
    region == "global" &
    scenario_source == "demo_2020"
)
data <- prep_trajectory(data)

plot_trajectory(
  data,
  center_y = TRUE,
  perc_y_scale = TRUE
)

Run the code above in your browser using DataLab