Load your r2dii libraries

The first step in your analysis will be to load in the recommended r2dii packages into your current R session. r2dii.data includes fake data to help demonstrate the tool and r2dii.match provides functions to help you easily match your loanbook to asset-level data.

To plot your results, you may also load the package r2dii.plot.

We also recommend packages in the tidyverse; they are optional but useful.

library(tidyverse)
#> ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
#> ✔ ggplot2 3.3.5     ✔ purrr   0.3.4
#> ✔ tibble  3.1.3     ✔ dplyr   1.0.7
#> ✔ tidyr   1.1.3     ✔ stringr 1.4.0
#> ✔ readr   2.0.1     ✔ forcats 0.5.1
#> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
#> ✖ dplyr::filter() masks stats::filter()
#> ✖ dplyr::lag()    masks stats::lag()

Calculate targets

You can calculate scenario targets using two different approaches: Market Share Approach, or Sectoral Decarbonization Approach.

Market Share Approach

The Market Share Approach is used to calculate scenario targets for the production of a technology in a sector. For example, we can use this approach to set targets for the production of electric vehicles in the automotive sector. This approach is recommended for sectors where a granular technology scenario roadmap exists.

Targets can be set at the portfolio level:

# Use these datasets to practice but eventually you should use your own data.
scenario <- r2dii.data::scenario_demo_2020
regions <- r2dii.data::region_isos_demo

market_share_targets_portfolio <- matched %>%
  target_market_share(
    ald = ald,
    scenario = scenario,
    region_isos = regions
  )

market_share_targets_portfolio
#> # A tibble: 2,334 × 8
#>    sector     technology  year region scenario_source metric     production
#>    <chr>      <chr>      <int> <chr>  <chr>           <chr>           <dbl>
#>  1 automotive electric    2020 global demo_2020       projected     324592.
#>  2 automotive electric    2020 global demo_2020       target_cps    324592.
#>  3 automotive electric    2020 global demo_2020       target_sds    324592.
#>  4 automotive electric    2020 global demo_2020       target_sps    324592.
#>  5 automotive electric    2021 global demo_2020       projected     339656.
#>  6 automotive electric    2021 global demo_2020       target_cps    329191.
#>  7 automotive electric    2021 global demo_2020       target_sds    352505.
#>  8 automotive electric    2021 global demo_2020       target_sps    330435.
#>  9 automotive electric    2022 global demo_2020       projected     354720.
#> 10 automotive electric    2022 global demo_2020       target_cps    333693.
#> # … with 2,324 more rows, and 1 more variable: technology_share <dbl>

Or at the company level:

market_share_targets_company <- matched %>%
  target_market_share(
    ald = ald,
    scenario = scenario,
    region_isos = regions,
    # Output results at company-level.
    by_company = TRUE 
  )
#> Warning: You've supplied `by_company = TRUE` and `weight_production = TRUE`.
#> This will result in company-level results, weighted by the portfolio
#> loan size, which is rarely useful. Did you mean to set one of these
#> arguments to `FALSE`?

market_share_targets_company
#> # A tibble: 32,946 × 9
#>    sector     technology  year region scenario_source name_ald metric production
#>    <chr>      <chr>      <int> <chr>  <chr>           <chr>    <chr>       <dbl>
#>  1 automotive electric    2020 global demo_2020       toyota … proje…    324592.
#>  2 automotive electric    2020 global demo_2020       toyota … targe…    324592.
#>  3 automotive electric    2020 global demo_2020       toyota … targe…    324592.
#>  4 automotive electric    2020 global demo_2020       toyota … targe…    324592.
#>  5 automotive electric    2021 global demo_2020       toyota … proje…    339656.
#>  6 automotive electric    2021 global demo_2020       toyota … targe…    329191.
#>  7 automotive electric    2021 global demo_2020       toyota … targe…    352505.
#>  8 automotive electric    2021 global demo_2020       toyota … targe…    330435.
#>  9 automotive electric    2022 global demo_2020       toyota … proje…    354720.
#> 10 automotive electric    2022 global demo_2020       toyota … targe…    333693.
#> # … with 32,936 more rows, and 1 more variable: technology_share <dbl>

Sectoral Decarbonization Approach

The Sectoral Decarbonization Approach is used to calculate scenario targets for the emission_factor of a sector. For example, you can use this approach to set targets for the average emission factor of the cement sector. This approach is recommended for sectors lacking technology roadmaps.

# Use this dataset to practice but eventually you should use your own data.
co2 <- r2dii.data::co2_intensity_scenario_demo

sda_targets <- matched %>%
  target_sda(ald = ald, co2_intensity_scenario = co2) %>% 
  filter(sector == "cement", year >= 2020)
#> Warning: Removing ald rows where `emission_factor` is NA

sda_targets
#> # A tibble: 74 × 4
#>    sector  year emission_factor_metric emission_factor_value
#>    <chr>  <dbl> <chr>                                  <dbl>
#>  1 cement  2020 projected                              0.664
#>  2 cement  2021 projected                              0.665
#>  3 cement  2022 projected                              0.666
#>  4 cement  2023 projected                              0.667
#>  5 cement  2024 projected                              0.668
#>  6 cement  2025 projected                              0.669
#>  7 cement  2020 corporate_economy                      0.669
#>  8 cement  2021 corporate_economy                      0.670
#>  9 cement  2022 corporate_economy                      0.671
#> 10 cement  2023 corporate_economy                      0.672
#> # … with 64 more rows

Visualization

There are a large variety of possible visualizations stemming from the outputs of target_market_share() and target_sda(). Below, we highlight a couple of common plots that can easily be created using the r2dii.plot package.

Market Share: Sector-level technology mix

From the market share output, you can plot the portfolio’s exposure to various climate sensitive technologies (projected), and compare with the corporate economy, or against various scenario targets.

# Pick the targets you want to plot.
data <- filter(
  market_share_targets_portfolio,
  scenario_source == "demo_2020",
  sector == "power",
  region == "global",
  metric %in% c("projected", "corporate_economy", "target_sds")
)

# Plot the technology mix
qplot_techmix(data)
#> Removing data before 2020 -- the start year of 'projected'.
#> The `technology_share` values are plotted for extreme years.
#> Do you want to plot different years? E.g. filter data with:`subset(data, year %in% c(2020, 2030))`.

Market Share: Technology-level volume trajectory

You can also plot the technology-specific volume trend. All starting values are normalized to 1, to emphasize that we are comparing the rates of buildout and/or retirement.

data <- filter(
  market_share_targets_portfolio,
  sector == "power",
  technology == "renewablescap",
  region == "global",
  scenario_source == "demo_2020"
)

qplot_trajectory(data)
#> Removing data before 2020 -- the start year of 'projected'.
#> Normalizing `production` values to 2020 -- the start year.

SDA Target

From the SDA output, we can compare the projected average emission intensity attributed to the portfolio, with the actual emission intensity scenario, and the scenario compliant SDA pathway that the portfolio must follow to achieve the scenario ambition by 2050.

data <- filter(sda_targets, sector == "cement")
qplot_emission_intensity(data)