join_ald_scenario() is a simple wrapper of several calls to dplyr::join_*(), forming the master dataset to be used in later steps of the analysis.

join_ald_scenario(
  data,
  ald,
  scenario,
  region_isos = r2dii.data::region_isos,
  add_green_technologies = FALSE
)

Arguments

data

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

ald

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

scenario

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

region_isos

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

add_green_technologies

Logical vector of length 1. FALSE defaults to outputting only technologies that are present in both data and ald. Set to FALSE to add rows of all possible green technologies (with 0 production).

Value

Returns a fully joined data frame, linking portfolio, ald and scenario.

See also

Other utility functions: summarize_weighted_production()

Examples

installed <- requireNamespace("r2dii.data", quietly = TRUE) && requireNamespace("r2dii.match", quietly = TRUE) if (installed) { library(r2dii.data) library(r2dii.match) valid_matches <- match_name(loanbook_demo, ald_demo) %>% # WARNING: Remember to validate matches (see `?prioritize`) prioritize() valid_matches %>% join_ald_scenario( ald = ald_demo, scenario = scenario_demo_2020, region_isos = region_isos_demo ) }
#> # A tibble: 9,099 × 45 #> id_loan id_direct_loanta… name_direct_loan… id_intermediate… name_intermedia… #> <chr> <chr> <chr> <chr> <chr> #> 1 L6 C304 Yukon Developmen… NA NA #> 2 L6 C304 Yukon Developmen… NA NA #> 3 L6 C304 Yukon Developmen… NA NA #> 4 L6 C304 Yukon Developmen… NA NA #> 5 L6 C304 Yukon Developmen… NA NA #> 6 L6 C304 Yukon Developmen… NA NA #> 7 L6 C304 Yukon Developmen… NA NA #> 8 L6 C304 Yukon Developmen… NA NA #> 9 L6 C304 Yukon Developmen… NA NA #> 10 L6 C304 Yukon Developmen… NA NA #> # … with 9,089 more rows, and 40 more variables: id_ultimate_parent <chr>, #> # name_ultimate_parent <chr>, loan_size_outstanding <dbl>, #> # loan_size_outstanding_currency <chr>, loan_size_credit_limit <dbl>, #> # loan_size_credit_limit_currency <chr>, sector_classification_system <chr>, #> # sector_classification_input_type <chr>, #> # sector_classification_direct_loantaker <dbl>, fi_type <chr>, #> # flag_project_finance_loan <chr>, name_project <lgl>, …