Skip to contents

This function calculates the portfolio-level production targets, as calculated using the market share approach applied to each relevant climate production forecast.

Usage

target_market_share(
  data,
  abcd,
  scenario,
  region_isos = r2dii.data::region_isos,
  use_credit_limit = FALSE,
  by_company = FALSE,
  weight_production = TRUE,
  ald = deprecated()
)

Arguments

data

A "data.frame" like the output of r2dii.match::prioritize.

abcd

An asset level data frame like r2dii.data::abcd_demo.

scenario

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

region_isos

A data frame like r2dii.data::region_isos (default).

use_credit_limit

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

by_company

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

weight_production

Logical vector of length 1. TRUE defaults to outputting production, weighted by relative loan-size. Set to FALSE to output the unweighted production values.

ald

[Superseded] ald has been superseded by abcd.

Value

A tibble including the summarized columns metric, production, technology_share, percentage_of_initial_production_by_scope and scope. If by_company = TRUE, the output will also have the column name_abcd.

Handling grouped data

This function ignores existing groups and outputs ungrouped data.

See also

Other functions to calculate scenario targets: target_sda()

Examples

installed <- requireNamespace("r2dii.data", quietly = TRUE) &&
  requireNamespace("r2dii.match", quietly = TRUE) &&
  packageVersion("r2dii.match") >= "0.1.0"

if (installed) {
  library(r2dii.data)
  library(r2dii.match)

  loanbook <- head(loanbook_demo, 100)
  abcd <- head(abcd_demo, 100)

  matched <- loanbook %>%
    match_name(abcd) %>%
    prioritize()

  # Calculate targets at portfolio level
  matched %>%
    target_market_share(
      abcd = abcd,
      scenario = scenario_demo_2020,
      region_isos = region_isos_demo
    )

  # Calculate targets at company level
  matched %>%
    target_market_share(
      abcd = abcd,
      scenario = scenario_demo_2020,
      region_isos = region_isos_demo,
      by_company = TRUE
    )

  matched %>%
    target_market_share(
      abcd = abcd,
      scenario = scenario_demo_2020,
      region_isos = region_isos_demo,
      # Calculate unweighted targets
      weight_production = FALSE
    )
}
#> Warning: You've supplied `by_company = TRUE` and `weight_production = TRUE`.
#> This will result in company-level results, weighted by the portfolio
#> loan size, which is rarely useful. Did you mean to set one of these
#> arguments to `FALSE`?
#> # A tibble: 315 × 10
#>    sector technology  year region scenar…¹ metric produ…² techn…³ scope percen…⁴
#>    <chr>  <chr>      <int> <chr>  <chr>    <chr>    <dbl>   <dbl> <chr>    <dbl>
#>  1 power  hydrocap    2020 global demo_20… proje… 121032.   0.5   sect…  0      
#>  2 power  hydrocap    2020 global demo_20… targe… 121032.   0.5   sect…  0      
#>  3 power  hydrocap    2020 global demo_20… targe… 121032.   0.5   sect…  0      
#>  4 power  hydrocap    2020 global demo_20… targe… 121032.   0.5   sect…  0      
#>  5 power  hydrocap    2021 global demo_20… proje… 119274.   0.5   sect… -1.30e-2
#>  6 power  hydrocap    2021 global demo_20… targe… 121141.   0.494 sect…  8.06e-4
#>  7 power  hydrocap    2021 global demo_20… targe… 121205.   0.491 sect…  1.28e-3
#>  8 power  hydrocap    2021 global demo_20… targe… 121151.   0.493 sect…  8.83e-4
#>  9 power  hydrocap    2022 global demo_20… proje… 117515.   0.5   sect… -2.60e-2
#> 10 power  hydrocap    2022 global demo_20… targe… 121250.   0.489 sect…  1.61e-3
#> # … with 305 more rows, and abbreviated variable names ¹​scenario_source,
#> #   ²​production, ³​technology_share, ⁴​percentage_of_initial_production_by_scope