-
Notifications
You must be signed in to change notification settings - Fork 6
/
README.Rmd
97 lines (71 loc) · 3.6 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# r2dii.match <img src="man/figures/logo.png" align="right" width="120" />
<!-- badges: start -->
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![CRAN status](https://www.r-pkg.org/badges/version/r2dii.match)](https://CRAN.R-project.org/package=r2dii.match)
[![](https://cranlogs.r-pkg.org/badges/grand-total/r2dii.match)](https://CRAN.R-project.org/package=r2dii.match)
[![Codecov test coverage](https://codecov.io/gh/RMI-PACTA/r2dii.match/branch/main/graph/badge.svg)](https://app.codecov.io/gh/RMI-PACTA/r2dii.match?branch=main)
[![R-CMD-check](https://github.com/RMI-PACTA/r2dii.match/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/RMI-PACTA/r2dii.match/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
These tools implement in R a fundamental part of
the software PACTA (Paris Agreement Capital Transition Assessment),
which is a free tool that calculates the alignment between financial
portfolios and climate scenarios (<https://www.transitionmonitor.com/>).
Financial institutions use PACTA to study how their capital
allocation impacts the climate. This package matches data from
financial portfolios to asset level data from market-intelligence
databases (e.g. power plant capacities, emission factors, etc.). This
is the first step to assess if a financial portfolio aligns with
climate goals.
## Installation
Install the released version of r2dii.match from CRAN with:
```r
# install.packages("r2dii.match")
```
Or install the development version of r2dii.match from GitHub with:
```r
# install.packages("pak")
pak::pak("RMI-PACTA/r2dii.match")
```
## Example
```{r}
library(r2dii.data)
library(r2dii.match)
```
Matching is achieved in two main steps:
### 1. Run fuzzy matching
`match_name()` will extract all unique counterparty names from the columns: `direct_loantaker`, `ultimate_parent` or `intermediate_parent*` and run fuzzy matching against all company names in the `abcd`:
```{r}
match_result <- match_name(loanbook_demo, abcd_demo)
match_result
```
### 2. Prioritize validated matches
The user should then manually validate the output of [match_name()], ensuring that the value of the column `score` is equal to `1` for perfect matches only.
Once validated, the `prioritize()` function, will choose only the valid matches, prioritizing (by default) `direct_loantaker` matches over `ultimate_parent` matches:
```{r}
prioritize(match_result)
```
The result is a dataset with identical columns to the input loanbook, and added columns bridging all matched loans to their abcd counterpart.
[Get started](https://rmi-pacta.github.io/r2dii.match/articles/r2dii-match.html).
```{r echo=FALSE}
download.file("http://bit.ly/banks-thanks", thanks <- tempfile())
```
## 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.