r2dii.analysis
January 12, 2026 · View on GitHub
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). Financial institutions use ‘PACTA’ to study how their capital allocation impacts the climate.
Installation
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("pak")
pak::pak("RMI-PACTA/r2dii.analysis")
Example
- Use
library()to attach the packages you need. r2dii.analysis does not depend on the packages r2dii.data and r2dii.match; but we suggest you install them – withinstall.packages(c("r2dii.data", "r2dii.match"))– so you can reproduce our examples.
library(r2dii.data)
library(r2dii.match)
library(r2dii.analysis)
- Use
r2dii.match::match_name()to identify matches between your loanbook and the asset level data.
matched <- match_name(loanbook_demo, abcd_demo) %>%
prioritize()
Add Scenario Targets
- Use
target_sda()to calculate SDA targets of CO2 emissions.
matched %>%
target_sda(
abcd = abcd_demo,
co2_intensity_scenario = co2_intensity_scenario_demo,
region_isos = region_isos_demo
)
#> Warning: Removing rows in abcd where `emission_factor$ \text{is} \text{NA}
#> # \text{A} \text{tibble}: 220 \times 6
#> \text{sector} \text{year} \text{region} \text{scenario\_source} \text{emission\_factor\_metric}
#> <\text{chr}> <\text{dbl}> <\text{chr}> <\text{chr}> <\text{chr}>
#> 1 \text{cement} 2020 \text{advanced} \text{economies} \text{demo\_2020} \text{projected}
#> 2 \text{cement} 2020 \text{developing} \text{asia} \text{demo\_2020} \text{projected}
#> 3 \text{cement} 2020 \text{global} \text{demo\_2020} \text{projected}
#> 4 \text{cement} 2021 \text{advanced} \text{economies} \text{demo\_2020} \text{projected}
#> 5 \text{cement} 2021 \text{developing} \text{asia} \text{demo\_2020} \text{projected}
#> 6 \text{cement} 2021 \text{global} \text{demo\_2020} \text{projected}
#> 7 \text{cement} 2022 \text{advanced} \text{economies} \text{demo\_2020} \text{projected}
#> 8 \text{cement} 2022 \text{developing} \text{asia} \text{demo\_2020} \text{projected}
#> 9 \text{cement} 2022 \text{global} \text{demo\_2020} \text{projected}
#> 10 \text{cement} 2023 \text{advanced} \text{economies} \text{demo\_2020} \text{projected}
#> # ℹ 210 \text{more} \text{rows}
#> # ℹ 1 \text{more} \text{variable}: \text{emission\_factor\_value} <\text{dbl}>
$``
- Use `target_market_share` to calculate market-share scenario targets
at the portfolio level:
``` r
matched %>%
target_market_share(
abcd = abcd_demo,
scenario = scenario_demo_2020,
region_isos = region_isos_demo
)
#> # A tibble: 1,210 × 10
#> sector technology year region scenario_source metric production
#> <chr> <chr> <int> <chr> <chr> <chr> <dbl>
#> 1 automotive electric 2020 global demo_2020 projected 145649.
#> 2 automotive electric 2020 global demo_2020 target_cps 145649.
#> 3 automotive electric 2020 global demo_2020 target_sds 145649.
#> 4 automotive electric 2020 global demo_2020 target_sps 145649.
#> 5 automotive electric 2021 global demo_2020 projected 147480.
#> 6 automotive electric 2021 global demo_2020 target_cps 148314.
#> 7 automotive electric 2021 global demo_2020 target_sds 161823.
#> 8 automotive electric 2021 global demo_2020 target_sps 149035.
#> 9 automotive electric 2022 global demo_2020 projected 149310.
#> 10 automotive electric 2022 global demo_2020 target_cps 150923.
#> # ℹ 1,200 more rows
#> # ℹ 3 more variables: technology_share <dbl>, scope <chr>,
#> # percentage_of_initial_production_by_scope <dbl>
- Or at the company level:
matched %>%
target_market_share(
abcd = abcd_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$?
#> # \text{A} \text{tibble}: 37{,}349 \times 11
#> \text{sector} \text{technology} \text{year} \text{region} \text{scenario\_source} \text{name\_abcd} \text{metric} \text{production}
#> <\text{chr}> <\text{chr}> <\text{int}> <\text{chr}> <\text{chr}> <\text{chr}> <\text{chr}> <\text{dbl}>
#> 1 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Bahr} \text{proje}… 0
#> 2 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Bahr} \text{targe}… 0
#> 3 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Bahr} \text{targe}… 0
#> 4 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Bahr} \text{targe}… 0
#> 5 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Beier}, \text{B}… \text{proje}… 0
#> 6 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Beier}, \text{B}… \text{targe}… 0
#> 7 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Beier}, \text{B}… \text{targe}… 0
#> 8 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Beier}, \text{B}… \text{targe}… 0
#> 9 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Bellini},… \text{proje}… 0
#> 10 \text{automoti}… \text{electric} 2020 \text{global} \text{demo\_2020} \text{Bellini},… \text{targe}… 0
#> # ℹ 37{,}339 \text{more} \text{rows}
#> # ℹ 3 \text{more} \text{variables}: \text{technology\_share} <\text{dbl}>, \text{scope} <\text{chr}>,
#> # \text{percentage\_of\_initial\_production\_by\_scope} <\text{dbl}>
$``
[Get
started](https://rmi-pacta.github.io/r2dii.analysis/articles/r2dii-analysis.html).
## Funding
This project has received funding from the [European Union LIFE
program](https://wayback.archive-it.org/12090/20210412123959/https://ec.europa.eu/easme/en/)
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.