View source: R/summarize_weighted_production.R
| summarize_weighted_production | R Documentation | 
Based on on the weight of each loan per sector per year,
summarize_weighted_production() and summarize_weighted_percent_change()
summarize the production and percent-change, respectively.
summarize_weighted_production(data, ..., use_credit_limit = FALSE) summarize_weighted_percent_change(data, ..., use_credit_limit = FALSE)
data | 
 A data frame like the output of   | 
... | 
 Variables to group by.  | 
use_credit_limit | 
 Logical vector of length 1.   | 
A tibble with the same groups as the input (if any) and columns:
sector, technology, and year; and weighted_production or
weighted_production for summarize_weighted_production() and
summarize_weighted_percent_change(), respectively.
The percent-change analysis excludes companies with 0 production. percent-change is undefined for companies that have no initial production; including such companies would cause percent-change percentage to be infinite, which is wrong.
join_abcd_scenario().
Other utility functions: 
join_abcd_scenario()
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, 150)
  abcd <- head(abcd_demo, 100)
  master <- loanbook %>%
    match_name(abcd) %>%
    prioritize() %>%
    join_abcd_scenario(
      abcd = abcd,
      scenario = scenario_demo_2020,
      region_isos = region_isos_demo
    )
  summarize_weighted_production(master)
  summarize_weighted_production(master, use_credit_limit = TRUE)
  summarize_weighted_percent_change(master)
  summarize_weighted_percent_change(master, use_credit_limit = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.