Title: | Measure Climate Scenario Alignment of Corporate Loans |
Version: | 0.5.2 |
Description: | These tools help you to assess if a corporate lending portfolio aligns with climate goals. They summarize key climate indicators attributed to the portfolio (e.g. production, emission factors), and calculate alignment targets based on climate scenarios. They implement in R the last step of the free software 'PACTA' (Paris Agreement Capital Transition Assessment; https://www.transitionmonitor.com/). Financial institutions use 'PACTA' to study how their capital allocation decisions align with climate change mitigation goals. |
License: | MIT + file LICENSE |
URL: | https://rmi-pacta.github.io/r2dii.analysis/, https://github.com/RMI-PACTA/r2dii.analysis |
BugReports: | https://github.com/RMI-PACTA/r2dii.analysis/issues |
Depends: | R (≥ 3.5) |
Imports: | dplyr (≥ 0.8.5), glue, lifecycle, magrittr, r2dii.data (≥ 0.4.0), rlang (≥ 0.1.2), tidyr, tidyselect, zoo |
Suggests: | cli, covr, r2dii.match, readr, rmarkdown, roxygen2, spelling, testthat (≥ 3.0.0), waldo, withr |
Config/testthat/edition: | 3 |
Config/Needs/website: | rmi-pacta/pacta.pkgdown.rmitemplate |
Encoding: | UTF-8 |
Language: | en-US |
RoxygenNote: | 7.3.2 |
LazyData: | true |
NeedsCompilation: | no |
Packaged: | 2025-06-17 13:29:41 UTC; cjrmi |
Author: | Jacob Kastl |
Maintainer: | Jacob Kastl <jacob.kastl@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-06-17 23:10:07 UTC |
r2dii.analysis: Measure Climate Scenario Alignment of Corporate Loans
Description
These tools help you to assess if a corporate lending portfolio aligns with climate goals. They summarize key climate indicators attributed to the portfolio (e.g. production, emission factors), and calculate alignment targets based on climate scenarios. They implement in R the last step of the free software 'PACTA' (Paris Agreement Capital Transition Assessment; https://www.transitionmonitor.com/). Financial institutions use 'PACTA' to study how their capital allocation decisions align with climate change mitigation goals.
Author(s)
Maintainer: Jacob Kastl jacob.kastl@gmail.com (ORCID) [contractor]
Authors:
Alex Axthelm aaxthelm@rmi.org (ORCID) [contractor]
Jackson Hoffart jackson.hoffart@gmail.com (ORCID) [contractor]
Mauro Lepore maurolepore@gmail.com (ORCID) [contractor]
Klaus Hogedorn klaus@2degrees-investing.org
Nicky Halterman nicholas.i.halterman@gmail.com
Other contributors:
RMI PACTA4banks@rmi.org [copyright holder, funder]
See Also
Useful links:
Report bugs at https://github.com/RMI-PACTA/r2dii.analysis/issues
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
Arguments
lhs |
A value or the magrittr placeholder. |
rhs |
A function call using the magrittr semantics. |
Value
The result of calling rhs(lhs)
.
Data Dictionary
Description
A table of column names and descriptions of data frames used or exported by the functions in this package.
Usage
data_dictionary
Format
data_dictionary
- dataset
Name of the dataset
- column
Name of the column
- typeof
Type of the column
- definition
Definition of the column
Examples
data_dictionary
Join a data-loanbook object to the abcd and scenario
Description
This function was deprecated because it is not required as a user-facing function for PACTA for Banks. It is still used internally though. All relevant outputs of the PACTA for Banks analysis can be obtained using the target_market_share() and target_sda() functions.
join_abcd_scenario()
is a simple wrapper of several calls to
dplyr::join_*()
, forming the master dataset to be used in later steps of
the analysis.
Usage
join_abcd_scenario(
data,
abcd,
scenario,
region_isos = r2dii.data::region_isos,
add_green_technologies = FALSE
)
Arguments
data |
A data frame like the output of
|
abcd |
An asset level data frame like r2dii.data::abcd_demo. |
scenario |
A scenario data frame like r2dii.data::scenario_demo_2020. |
region_isos |
A data frame like r2dii.data::region_isos (default). |
add_green_technologies |
Logical vector of length 1. |
Value
Returns a fully joined data frame, linking portfolio, abcd and scenario.
See Also
Other utility functions:
summarize_weighted_production()
Examples
library(r2dii.data)
library(r2dii.match)
valid_matches <- match_name(loanbook_demo, abcd_demo) %>%
# WARNING: Remember to validate matches (see `?prioritize`)
prioritize()
valid_matches %>%
join_abcd_scenario(
abcd = abcd_demo,
scenario = scenario_demo_2020,
region_isos = region_isos_demo
)
Summaries based on the weight of each loan per sector per year
Description
These functions (summarize_weighted_production() and summarize_weighted_percent_change()) were deprecated because they are not required as a user-facing function for PACTA for Banks. They are still used internally though. All relevant outputs of the PACTA for Banks analysis can be obtained using the target_market_share() and target_sda() functions.
Based on on the weight of each loan per sector per year,
summarize_weighted_production()
and summarize_weighted_percent_change()
summarize the production and percent-change, respectively.
Usage
summarize_weighted_production(data, ..., use_credit_limit = FALSE)
summarize_weighted_percent_change(data, ..., use_credit_limit = FALSE)
Arguments
data |
A data frame like the output of |
... |
Variables to group by. |
use_credit_limit |
Logical vector of length 1. |
Value
A tibble with the same groups as the input (if any) and columns:
sector
, technology
, and year
; and weighted_production
or
weighted_production
for summarize_weighted_production()
and
summarize_weighted_percent_change()
, respectively.
Warning
The percent-change analysis excludes companies with 0 production. percent-change is undefined for companies that have no initial production; including such companies would cause percent-change percentage to be infinite, which is wrong.
See Also
Other utility functions:
join_abcd_scenario()
Examples
library(r2dii.data)
library(r2dii.match)
loanbook <- head(loanbook_demo, 150)
abcd <- head(abcd_demo, 100)
master <- loanbook %>%
match_name(abcd) %>%
prioritize() %>%
join_abcd_scenario(
abcd = abcd,
scenario = scenario_demo_2020,
region_isos = region_isos_demo
) %>%
dplyr::filter(production != 0)
summarize_weighted_production(master)
summarize_weighted_production(master, use_credit_limit = TRUE)
summarize_weighted_percent_change(master)
summarize_weighted_percent_change(master, use_credit_limit = TRUE)
Add targets for production, using the market share approach
Description
This function calculates the portfolio-level production targets, as calculated using the market share approach applied to each relevant climate production forecast.
Usage
target_market_share(
data,
abcd,
scenario,
region_isos = r2dii.data::region_isos,
use_credit_limit = FALSE,
by_company = FALSE,
weight_production = TRUE,
increasing_or_decreasing = r2dii.data::increasing_or_decreasing
)
Arguments
data |
A "data.frame" like the output of |
abcd |
An asset level data frame like r2dii.data::abcd_demo. |
scenario |
A scenario data frame like r2dii.data::scenario_demo_2020. |
region_isos |
A data frame like r2dii.data::region_isos (default). |
use_credit_limit |
Logical vector of length 1. |
by_company |
Logical vector of length 1. |
weight_production |
Logical vector of length 1. |
increasing_or_decreasing |
A data frame like r2dii.data::increasing_or_decreasing. |
Value
A tibble including the summarized columns metric
, production
,
technology_share
, percentage_of_initial_production_by_scope
and
scope
. If by_company = TRUE
, the output will also have the column
name_abcd
.
Handling grouped data
This function ignores existing groups and outputs ungrouped data.
See Also
Other functions to calculate scenario targets:
target_sda()
Examples
library(r2dii.data)
library(r2dii.match)
loanbook <- head(loanbook_demo, 100)
abcd <- head(abcd_demo, 100)
matched <- loanbook %>%
match_name(abcd) %>%
prioritize()
# Calculate targets at portfolio level
matched %>%
target_market_share(
abcd = abcd,
scenario = scenario_demo_2020,
region_isos = region_isos_demo
)
# Calculate targets at company level
matched %>%
target_market_share(
abcd = abcd,
scenario = scenario_demo_2020,
region_isos = region_isos_demo,
by_company = TRUE
)
matched %>%
target_market_share(
abcd = abcd,
scenario = scenario_demo_2020,
region_isos = region_isos_demo,
# Calculate unweighted targets
weight_production = FALSE
)
Add targets for CO2 emissions per unit production at the portfolio level, using the SDA approach
Description
This function calculates targets of CO2 emissions per unit production at the portfolio-level, otherwise referred to as "emissions factors". It uses the sectoral-decarbonization approach (SDA) to calculate these targets.
Usage
target_sda(
data,
abcd,
co2_intensity_scenario,
use_credit_limit = FALSE,
by_company = FALSE,
region_isos = r2dii.data::region_isos
)
Arguments
data |
A dataframe like the output of
|
abcd |
An asset-level data frame like r2dii.data::abcd_demo. |
co2_intensity_scenario |
A scenario data frame like r2dii.data::co2_intensity_scenario_demo. |
use_credit_limit |
Logical vector of length 1. |
by_company |
Logical vector of length 1. |
region_isos |
A data frame like r2dii.data::region_isos (default). |
Value
A tibble including the summarized columns emission_factor_metric
and
emission_factor_value
. If by_company = TRUE
, the output will also have
the column name_abcd
.
Handling grouped data
This function ignores existing groups and outputs ungrouped data.
See Also
Other functions to calculate scenario targets:
target_market_share()
Examples
library(r2dii.match)
library(r2dii.data)
loanbook <- head(loanbook_demo, 150)
abcd <- head(abcd_demo, 100)
matched <- loanbook %>%
match_name(abcd) %>%
prioritize()
# Calculate targets at portfolio level
matched %>%
target_sda(
abcd = abcd,
co2_intensity_scenario = co2_intensity_scenario_demo,
region_isos = region_isos_demo
)
# Calculate targets at company level
matched %>%
target_sda(
abcd = abcd,
co2_intensity_scenario = co2_intensity_scenario_demo,
region_isos = region_isos_demo,
by_company = TRUE
)
Tidy eval helpers
Description
To learn more about tidy eval and how to use these tools, check out the Metaprogramming section of Advanced R.
Value
-
sym()
creates a symbol from a string andsyms()
creates a list of symbols from a character vector. -
enquo()
andenquos()
delay the execution of one or several function arguments.enquo()
returns a single quoted expression, which is like a blueprint for the delayed computation.enquos()
returns a list of such quoted expressions. -
expr()
quotes a new expression locally. It is mostly useful to build new expressions around arguments captured withenquo()
orenquos()
:expr(mean(!!enquo(arg), na.rm = TRUE))
. -
as_name()
transforms a quoted variable name into a string. Supplying something else than a quoted variable name is an error.That's unlike
as_label()
which also returns a single string but supports any kind of R object as input, including quoted function calls and vectors. Its purpose is to summarise that object into a single label. That label is often suitable as a default name.If you don't know what a quoted expression contains (for instance expressions captured with
enquo()
could be a variable name, a call to a function, or an unquoted constant), then useas_label()
. If you know you have quoted a simple variable name, or would like to enforce this, useas_name()
.