Learn R Programming

pacta.loanbook

Overview

{pacta.loanbook} supports the PACTA analysis of corporate lending portfolios—loanbooks—by providing an easy way to install, load and run the necessary underlying R packages.

In addition to simplifying package management, {pacta.loanbook} serves as a central resource for documentation. The cookbook explains in detail how you can run a PACTA analysis.

If you’re new to climate scenario alignment and PACTA, see the PACTA website for more information about PACTA for Banks, more on PACTA methodology, and other PACTA applications.

Installation

You can install the release version of the package by running the following command in R:

install.packages("pacta.loanbook")

Usage

library(pacta.loanbook) will load all the functions and datasets from the underlying packages:

  • r2dii.data, for input data sets used in PACTA for Banks (e.g. sector classification systems, regional mappers, data dictionary, demo data).
  • r2dii.match, for matching counterparties in raw input loan books with companies in the asset-based company data (ABCD).
  • r2dii.analysis, for calculating the alignment of loan books and/or counterparties with climate transition scenarios.
  • r2dii.plot, for plotting the results of the alignment analysis in standard PACTA plot format.

Refer to the cookbook for a detailed explanation on how to use the software.

Copy Link

Version

Install

install.packages('pacta.loanbook')

Monthly Downloads

212

Version

0.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jacob Kastl

Last Published

March 17th, 2025

Functions in pacta.loanbook (0.1.0)

pacta_loanbook_logo

The {pacta.loanbook} logo, using ASCII or Unicode characters
naics_classification

Dataset to bridge (translate) common sector-classification codes
nace_classification

Dataset to bridge (translate) common sector-classification codes
pacta.loanbook-package

pacta.loanbook: Easily Install and Load PACTA for Banks Packages
pacta_loanbook_update

Update {pacta.loanbook} packages
pacta_loanbook_sitrep

Get a situation report on {pacta.loanbook}
plot_trajectory

Create a trajectory plot
prep_emission_intensity

Prepare data for a emission intensity plot
palette_colours

Colour datasets
region_isos

A dataset outlining various region definitions
recode_metric_techmix

Replicate labels produced with qplot_*() functions
recode_metric_trajectory

Replicate labels produced with qplot_*() functions
scale_colour_r2dii_sector

Custom 2DII sector colour and fill scales
plot_emission_intensity

Create an emission intensity plot
scale_colour_r2dii

Custom 2DII colour and fill scales
plot_techmix

Create a techmix plot
region_isos_demo

A dataset outlining various region definitions
scale_fill_r2dii_tech

Custom 2DII technology colour and fill scales
scenario_demo_2020

A prepared climate scenario dataset for demonstration
scenario_colours

Colour datasets
sic_classification

Dataset to bridge (translate) common sector-classification codes
sector_colours

Colour datasets
scale_fill_r2dii_sector

Custom 2DII sector colour and fill scales
prep_techmix

Prepare data for plotting technology mix
prioritize

Pick rows where score is 1 and level per loan is of highest priority
target_market_share

Add targets for production, using the market share approach
spell_out_technology

Replicate labels produced with qplot_*() functions
prioritize_level

Arrange unique level values in default order of priority
technology_colours

Colour datasets
target_sda

Add targets for CO2 emissions per unit production at the portfolio level, using the SDA approach
sda

An example of an sda-like dataset
qplot_emission_intensity

Create a quick emission intensity plot
prep_trajectory

Prepare data for a trajectory plot
to_title

Replicate labels produced with qplot_*() functions
psic_classification

Dataset to bridge (translate) common sector-classification codes
scale_colour_r2dii_tech

Custom 2DII technology colour and fill scales
qplot_techmix

Create a quick techmix plot
scale_fill_r2dii

Custom 2DII colour and fill scales
qplot_trajectory

Create a quick trajectory plot
theme_2dii

Complete theme
sector_classifications

A view of available sector classification datasets
data_dictionary

Data Dictionary
crucial_lbk

Crucial loanbook columns for match_name()
pacta_loanbook_packages

List all packages in {pacta.loanbook}
match_name

Match a loanbook to asset-based company data (abcd) by the name_* columns
isic_classification

Dataset to bridge (translate) common sector-classification codes
gics_classification

Dataset to bridge (translate) common sector-classification codes
loanbook_demo

A loanbook dataset for demonstration
abcd_demo

An asset-based company dataset for demonstration
co2_intensity_scenario_demo

A prepared co2 intensity climate scenario dataset for demonstration
iso_codes

Countries and codes
market_share

An example of a market_share-like dataset
overwrite_demo

A demonstration dataset used to overwrite specific entity names or sectors
increasing_or_decreasing

Determine if a technology is increasing or decreasing
pacta_loanbook_deps

List all {pacta.loanbook} dependencies
pacta_loanbook_conflicts

Conflicts between the {pacta.loanbook} and other packages