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

263

Version

0.1.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jacob Kastl

Last Published

June 24th, 2025

Functions in pacta.loanbook (0.1.1)

plot_techmix

Create a techmix plot
plot_emission_intensity

Create an emission intensity plot
prep_techmix

Prepare data for plotting technology mix
pacta_loanbook_deps

List all {pacta.loanbook} dependencies
pacta_loanbook_logo

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

List all packages in {pacta.loanbook}
plot_trajectory

Create a trajectory plot
prioritize_level

Arrange unique level values in default order of priority
region_isos

A dataset outlining various region definitions
pacta_loanbook_sitrep

Get a situation report on {pacta.loanbook}
prioritize

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

Create a quick techmix plot
qplot_trajectory

Create a quick trajectory plot
region_isos_demo

A dataset outlining various region definitions
sda_demo

An example of an sda_demo-like dataset
qplot_emission_intensity

Create a quick emission intensity plot
scale_fill_r2dii

Custom PACTA colour and fill scales
psic_classification

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

Custom PACTA technology colour and fill scales
pacta_loanbook_update

Update {pacta.loanbook} packages
match_name

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

Colour datasets
nace_classification

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

Custom PACTA colour and fill scales
scale_colour_r2dii_sector

Custom PACTA sector colour and fill scales
theme_2dii

Complete theme
prep_trajectory

Prepare data for a trajectory plot
sector_classifications

A view of available sector classification datasets
spell_out_technology

Replicate labels produced with qplot_*() functions
target_market_share

Add targets for production, using the market share approach
sector_colours

Colour datasets
target_sda

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

Colour datasets
sic_classification

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

Replicate labels produced with qplot_*() functions
recode_metric_trajectory

Replicate labels produced with qplot_*() functions
prep_emission_intensity

Prepare data for a emission intensity plot
scale_fill_r2dii_tech

Custom PACTA technology colour and fill scales
recode_metric_techmix

Replicate labels produced with qplot_*() functions
scale_fill_r2dii_sector

Custom PACTA sector colour and fill scales
scenario_colours

Colour datasets
scenario_demo_2020

A prepared climate scenario dataset for demonstration
market_share_demo

An example of a market_share_demo-like dataset
crucial_lbk

Crucial loanbook columns for match_name()
pacta_loanbook_conflicts

Conflicts between the {pacta.loanbook} and other packages
increasing_or_decreasing

Determine if a technology is increasing or decreasing
data_dictionary

Data Dictionary
abcd_demo

An asset-based company dataset for demonstration
loanbook_demo

A loanbook dataset for demonstration
naics_classification

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

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

A prepared CO2 intensity climate scenario dataset for demonstration
isic_classification

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

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

Countries and codes
gics_classification

Dataset to bridge (translate) common sector-classification codes