r2dii.analysis

Lifecycle: maturing CRAN status Codecov test coverage R build status

These tools help you to assess if a financial portfolio aligns with climate goals. They summarize key metrics attributed to the portfolio (e.g. production, emission factors), and calculate targets based on climate scenarios. They implement in R the last step of the free software ‘PACTA’ (Paris Agreement Capital Transition Assessment; https://2degrees-investing.org/). Financial institutions use ‘PACTA’ to study how their capital allocation impacts the climate.

Installation

Before you install r2dii.analysis you may want to:

When you are ready, install the released version of r2dii.analysis from CRAN with:

install.packages("r2dii.analysis")

Or install the development version of r2dii.analysis from GitHub with:

# install.packages("devtools")
devtools::install_github("2DegreesInvesting/r2dii.analysis")

How to raise an issue?

Example

library(r2dii.data)
library(r2dii.match)
library(r2dii.analysis)
matched <- match_name(loanbook_demo, ald_demo) %>%
  prioritize()

Add Scenario Targets

matched %>%
  target_sda(
    ald = ald_demo,
    co2_intensity_scenario = co2_intensity_scenario_demo
  )
#> Warning: Removing ald rows where `emission_factor` is NA
#> # A tibble: 208 x 4
#>    sector      year emission_factor_metric emission_factor_value
#>    <chr>      <dbl> <chr>                                  <dbl>
#>  1 automotive  2002 projected                              0.228
#>  2 automotive  2003 projected                              0.226
#>  3 automotive  2004 projected                              0.224
#>  4 automotive  2005 projected                              0.222
#>  5 automotive  2006 projected                              0.220
#>  6 automotive  2007 projected                              0.218
#>  7 automotive  2008 projected                              0.216
#>  8 automotive  2009 projected                              0.214
#>  9 automotive  2010 projected                              0.212
#> 10 automotive  2011 projected                              0.210
#> # … with 198 more rows
matched %>%
  target_market_share(
    ald = ald_demo,
    scenario = scenario_demo_2020,
    region_isos = region_isos_demo
  )
#> # A tibble: 1,170 x 8
#>    sector technology  year region scenario_source metric production
#>    <chr>  <chr>      <int> <chr>  <chr>           <chr>       <dbl>
#>  1 autom… electric    2020 global demo_2020       proje…    145942.
#>  2 autom… electric    2020 global demo_2020       corpo…   8134869.
#>  3 autom… electric    2020 global demo_2020       targe…    145942.
#>  4 autom… electric    2020 global demo_2020       targe…    145942.
#>  5 autom… electric    2020 global demo_2020       targe…    145942.
#>  6 autom… electric    2021 global demo_2020       proje…    148212.
#>  7 autom… electric    2021 global demo_2020       corpo…   8183411.
#>  8 autom… electric    2021 global demo_2020       targe…    148361.
#>  9 autom… electric    2021 global demo_2020       targe…    160625.
#> 10 autom… electric    2021 global demo_2020       targe…    149016.
#> # … with 1,160 more rows, and 1 more variable: technology_share <dbl>
matched %>%
  target_market_share(
    ald = ald_demo,
    scenario = scenario_demo_2020,
    region_isos = region_isos_demo,
    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`?
#> # A tibble: 15,945 x 9
#>    sector technology  year region scenario_source name_ald metric production
#>    <chr>  <chr>      <int> <chr>  <chr>           <chr>    <chr>       <dbl>
#>  1 autom… electric    2020 global demo_2020       shangha… proje…      5140.
#>  2 autom… electric    2020 global demo_2020       shangha… corpo…   8134869.
#>  3 autom… electric    2020 global demo_2020       shangha… targe…      5140.
#>  4 autom… electric    2020 global demo_2020       shangha… targe…      5140.
#>  5 autom… electric    2020 global demo_2020       shangha… targe…      5140.
#>  6 autom… electric    2020 global demo_2020       sichuan… proje…      2992.
#>  7 autom… electric    2020 global demo_2020       sichuan… corpo…   8134869.
#>  8 autom… electric    2020 global demo_2020       sichuan… targe…      2992.
#>  9 autom… electric    2020 global demo_2020       sichuan… targe…      2992.
#> 10 autom… electric    2020 global demo_2020       sichuan… targe…      2992.
#> # … with 15,935 more rows, and 1 more variable: technology_share <dbl>

Utility Functions

The target_*() functions provide shortcuts for common operations. They wrap some utility functions that you may also use directly:

loanbook_joined_to_ald_scenario <- matched %>%
  join_ald_scenario(
    ald = ald_demo,
    scenario = scenario_demo_2020,
    region_isos = region_isos_demo
  )
# portfolio level
loanbook_joined_to_ald_scenario %>%
  summarize_weighted_production(scenario, tmsr, smsp, region)
#> # A tibble: 702 x 9
#>    sector_ald technology  year scenario  tmsr    smsp region weighted_produc…
#>    <chr>      <chr>      <int> <chr>    <dbl>   <dbl> <chr>             <dbl>
#>  1 automotive electric    2020 cps       1    0       global          145942.
#>  2 automotive electric    2020 sds       1    0       global          145942.
#>  3 automotive electric    2020 sps       1    0       global          145942.
#>  4 automotive electric    2021 cps       1.12 0.00108 global          148212.
#>  5 automotive electric    2021 sds       1.16 0.00653 global          148212.
#>  6 automotive electric    2021 sps       1.14 0.00137 global          148212.
#>  7 automotive electric    2022 cps       1.24 0.00213 global          150481.
#>  8 automotive electric    2022 sds       1.32 0.0131  global          150481.
#>  9 automotive electric    2022 sps       1.29 0.00273 global          150481.
#> 10 automotive electric    2023 cps       1.35 0.00316 global          152751.
#> # … with 692 more rows, and 1 more variable: weighted_technology_share <dbl>

# company level
loanbook_joined_to_ald_scenario %>%
  summarize_weighted_production(scenario, tmsr, smsp, region, name_ald)
#> # A tibble: 9,567 x 10
#>    sector_ald technology  year scenario  tmsr  smsp region name_ald
#>    <chr>      <chr>      <int> <chr>    <dbl> <dbl> <chr>  <chr>   
#>  1 automotive electric    2020 cps          1     0 global shangha…
#>  2 automotive electric    2020 cps          1     0 global sichuan…
#>  3 automotive electric    2020 cps          1     0 global singula…
#>  4 automotive electric    2020 cps          1     0 global south-e…
#>  5 automotive electric    2020 cps          1     0 global suzuki …
#>  6 automotive electric    2020 cps          1     0 global tata gr…
#>  7 automotive electric    2020 cps          1     0 global tesla i…
#>  8 automotive electric    2020 cps          1     0 global toyota …
#>  9 automotive electric    2020 cps          1     0 global volkswa…
#> 10 automotive electric    2020 cps          1     0 global wheego  
#> # … with 9,557 more rows, and 2 more variables: weighted_production <dbl>,
#> #   weighted_technology_share <dbl>

Get started.

Funding

This project has received funding from the European Union LIFE program and the International Climate Initiative (IKI). The Federal Ministry for the Environment, Nature Conservation and Nuclear Safety (BMU) supports this initiative on the basis of a decision adopted by the German Bundestag. The views expressed are the sole responsibility of the authors and do not necessarily reflect the views of the funders. The funders are not responsible for any use that may be made of the information it contains.