Skip to contents

Adds the risk classification to calculated transition risk scores from emission profile and sector profile indicator.

Usage

transition_risk_profile(
  emissions_profile,
  sector_profile,
  co2,
  all_activities_scenario_sectors,
  scenarios,
  for_webtool = FALSE
)

Arguments

emissions_profile

Nested data frame. The output of profile_emissions().

sector_profile

Nested data frame. The output of profile_sector().

co2

A dataframe

all_activities_scenario_sectors

A dataframe

scenarios

A dataframe

for_webtool

Logical. Is it output for webtool or not?

Value

A data frame with the column companies_id, and the nested columnsproduct and company holding the outputs at product and company level.

See also

Other top-level functions: score_transition_risk()

Examples

library(readr, warn.conflicts = FALSE)
library(dplyr, warn.conflicts = FALSE)
library(tiltToyData, warn.conflicts = FALSE)
library(tiltIndicator)
library(tiltIndicatorAfter)

set.seed(123)
restore <- options(list(
  readr.show_col_types = FALSE,
  tiltIndicatorAfter.output_co2_footprint = TRUE
))

toy_emissions_profile_products_ecoinvent <- read_csv(toy_emissions_profile_products_ecoinvent())
toy_emissions_profile_any_companies <- read_csv(toy_emissions_profile_any_companies())
toy_sector_profile_any_scenarios <- read_csv(toy_sector_profile_any_scenarios())
toy_sector_profile_companies <- read_csv(toy_sector_profile_companies())
toy_europages_companies <- read_csv(toy_europages_companies())
toy_ecoinvent_activities <- read_csv(toy_ecoinvent_activities())
toy_ecoinvent_europages <- read_csv(toy_ecoinvent_europages())
toy_ecoinvent_inputs <- read_csv(toy_ecoinvent_inputs())
toy_isic_name <- read_csv(toy_isic_name())
toy_all_activities_scenario_sectors <- read_csv(toy_all_activities_scenario_sectors())

toy_emissions_profile <- profile_emissions(
  companies = toy_emissions_profile_any_companies,
  co2 = toy_emissions_profile_products_ecoinvent,
  europages_companies = toy_europages_companies,
  ecoinvent_activities = toy_ecoinvent_activities,
  ecoinvent_europages = toy_ecoinvent_europages,
  isic = toy_isic_name
)

toy_sector_profile <- profile_sector(
  companies = toy_sector_profile_companies,
  scenarios = toy_sector_profile_any_scenarios,
  europages_companies = toy_europages_companies,
  ecoinvent_activities = toy_ecoinvent_activities,
  ecoinvent_europages = toy_ecoinvent_europages,
  isic = toy_isic_name
)

output <- transition_risk_profile(
  emissions_profile = toy_emissions_profile,
  sector_profile = toy_sector_profile,
  co2 = toy_emissions_profile_products_ecoinvent,
  all_activities_scenario_sectors = toy_all_activities_scenario_sectors,
  scenarios = toy_sector_profile_any_scenarios,
  for_webtool = FALSE
)

output |> unnest_product()
#> # A tibble: 1,824 × 45
#>    companies_id      company_name country postcode address main_activity product
#>    <chr>             <chr>        <chr>   <chr>    <chr>   <chr>         <chr>  
#>  1 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#>  2 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#>  3 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#>  4 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#>  5 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#>  6 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#>  7 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#>  8 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#>  9 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#> 10 asteria_megaloto… asteria_meg… austria 3150     flesch… wholesaler    tent   
#> # ℹ 1,814 more rows
#> # ℹ 38 more variables: matched_activity_name <chr>,
#> #   matched_reference_product <chr>, matching_certainty <chr>,
#> #   co2_footprint <dbl>, unit <chr>, isic_4digit <chr>, tilt_sector <chr>,
#> #   tilt_subsector <chr>, grouping_emission <chr>, co2e_lower <dbl>,
#> #   co2e_upper <dbl>, emission_rank <dbl>, emission_category <chr>,
#> #   emissions_profile_equal_weight <dbl>, emissions_profile_best_case <dbl>, …

output |> unnest_company()
#> # A tibble: 1,728 × 38
#>    companies_id                  company_name country co2e_avg grouping_emission
#>    <chr>                         <chr>        <chr>      <dbl> <chr>            
#>  1 asteria_megalotomusquinquesp… asteria_meg… austria     303. all              
#>  2 asteria_megalotomusquinquesp… asteria_meg… austria     303. all              
#>  3 asteria_megalotomusquinquesp… asteria_meg… austria     303. all              
#>  4 asteria_megalotomusquinquesp… asteria_meg… austria     303. all              
#>  5 asteria_megalotomusquinquesp… asteria_meg… austria     303. isic_4digit      
#>  6 asteria_megalotomusquinquesp… asteria_meg… austria     303. isic_4digit      
#>  7 asteria_megalotomusquinquesp… asteria_meg… austria     303. isic_4digit      
#>  8 asteria_megalotomusquinquesp… asteria_meg… austria     303. isic_4digit      
#>  9 asteria_megalotomusquinquesp… asteria_meg… austria     303. tilt_subsector   
#> 10 asteria_megalotomusquinquesp… asteria_meg… austria     303. tilt_subsector   
#> # ℹ 1,718 more rows
#> # ℹ 33 more variables: emission_rank_avg_equal_weight <dbl>,
#> #   emission_rank_avg_best_case <dbl>, emission_rank_avg_worst_case <dbl>,
#> #   emission_category_low <dbl>, emission_category_medium <dbl>,
#> #   emission_category_high <dbl>, emission_category_NA <dbl>, scenario <chr>,
#> #   year <dbl>, sector_target_avg_equal_weight <dbl>,
#> #   sector_target_avg_best_case <dbl>, sector_target_avg_worst_case <dbl>, …