target_sda: Add targets for CO2 emissions per unit production at the...

Description Usage Arguments Value Handling grouped data See Also Examples

View source: R/target_sda.R

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

1
2
3
4
5
6
7
target_sda(
  data,
  ald,
  co2_intensity_scenario,
  use_credit_limit = FALSE,
  by_company = FALSE
)

Arguments

data

A dataframe like the output of r2dii.match::prioritize().

ald

An asset-level data frame like r2dii.data::ald_demo.

co2_intensity_scenario

A scenario data frame like r2dii.data::co2_intensity_scenario_demo.

use_credit_limit

Logical vector of length 1. FALSE defaults to using the column loan_size_outstanding. Set to TRUE to instead use the column loan_size_credit_limit.

by_company

Logical vector of length 1. FALSE defaults to outputting weighted_production_value at the portfolio-level. Set to TRUE to output weighted_production_value at the company-level.

Value

A tibble with the CO2 emissions factors attributed to the portfolio. These values include the portfolio's actual projected CO2 emissions factors, the scenario pathway CO2 emissions factors and the SDA calculated portfolio target emissions factors (see column emission_factor_metric).

Handling grouped data

This function ignores existing groups and outputs ungrouped data.

See Also

Other functions to calculate scenario targets: target_market_share()

Examples

 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
installed <- requireNamespace("r2dii.match", quietly = TRUE) &&
  requireNamespace("r2dii.data", quietly = TRUE)
if (installed) {
  library(r2dii.match)
  library(r2dii.data)

  # Example datasets from r2dii.data
  loanbook <- head(loanbook_demo, 150)
  ald <- head(ald_demo, 100)

  co2_scenario <- co2_intensity_scenario_demo

  # WARNING: Remember to validate matches (see `?prioritize`)
  matched <- prioritize(match_name(loanbook, ald))

  # You may need to clean your data
  anyNA(ald$emission_factor)
  try(target_sda(matched, ald, co2_intensity_scenario = co2_scenario))

  ald2 <- subset(ald, !is.na(emission_factor))
  anyNA(ald2$emission_factor)

  out <- target_sda(matched, ald2, co2_intensity_scenario = co2_scenario)

  # The output includes the portfolio's actual projected emissions factors, the
  # scenario pathway emissions factors, and the portfolio's target emissions
  # factors.
  out

  # Split-view by metric
  split(out, out$emission_factor_metric)

  # Calculate company-level targets
  out <- target_sda(
    matched, ald2,
    co2_intensity_scenario = co2_scenario,
    by_company = TRUE
  )
  out
}

r2dii.analysis documentation built on Aug. 18, 2021, 9:06 a.m.