calculate_tdm: Calculate and add the transition disruption metric to a...

View source: R/calculate_tdm.R

calculate_tdmR Documentation

Calculate and add the transition disruption metric to a dataset

Description

This function takes a typical PACTA output, and uses it to calculate the transition disruption metric.

Usage

calculate_tdm(
  data,
  t0,
  delta_t1 = 5,
  delta_t2 = 10,
  additional_groups = NULL,
  scenarios = "IPR FPS 2021"
)

Arguments

data

A data.frame (or tibble), with a format similar to the ⁠*_results_portfolio.rda⁠ outputs of PACTA.

t0

The start year, from which the TDM value should be calculated. This value should coincide with the earliest year in the PACTA results dataset.

delta_t1

The number of years into the future for which there is production data. The default value is 5 years since this is often the limit of the forward-looking data.

delta_t2

The number of years into the future against which you want to calculate disruption.

additional_groups

Character vector. The names of columns to group by, in addition to these ones (which are always used):

technology, ald_sector

scenarios

Character vector. The names of scenarios for which TDM should be calculated.

Value

A tibble with the columns specified in the additional_groups input as well as tdm_technology_value: the technology level transition disruption metric, tdm_sector_value: the sector level transition disruption metric, tdm_portfolio_value: the portfolio level transition disruption metric, tdm_metric: a flag that indicates what each ⁠tdm_*_value⁠ is being calculated against (e.g. "portfolio" or "scenario"), as well as tdm_t0, tdm_delta_t1 and tdm_delta_t2: corresponding to the input arguments.

Examples

library(tibble)

pacta_results <- tibble(
  investor_name = rep("some_investor", 3),
  portfolio_name = rep("some_portfolio", 3),
  scenario = rep("IPR FPS 2021", 3),
  allocation = rep("portfolio_weight", 3),
  equity_market = rep("GlobalMarket", 3),
  scenario_geography = rep("Global", 3),
  ald_sector = rep("Power", 3),
  technology = rep("RenewablesCap", 3),
  year = c(2020, 2025, 2030),
  plan_alloc_wt_tech_prod = rep(1, 3),
  scen_alloc_wt_tech_prod = 1:3,
  plan_carsten = rep(0.5, 3)
)
pacta_results

calculate_tdm(pacta_results, t0 = 2020)

2DegreesInvesting/PACTA_analysis documentation built on April 19, 2023, 6:42 p.m.