These functions wrap the output of the corresponding function in tiltIndicator.
Usage
profile_emissions_upstream(
companies,
co2,
europages_companies,
ecoinvent_activities,
ecoinvent_inputs,
ecoinvent_europages,
isic,
isic_tilt = lifecycle::deprecated(),
low_threshold = 1/3,
high_threshold = 2/3
)
Arguments
- companies, co2
A dataframe like the dataset with a matching name in tiltToyData (see Reference).
- europages_companies
Dataframe. Companies from europages.
- ecoinvent_activities
Dataframe. Activities from ecoinvent.
- ecoinvent_inputs
Dataframe. Upstream products from ecoinvent.
- ecoinvent_europages
Dataframe. Mapper between europages and ecoinvent.
- isic
Dataframe. ISIC data.
- isic_tilt
- low_threshold
A numeric value to segment low and medium emission profile products.
- high_threshold
A numeric value to segment medium and high emission profile products.
Value
A data frame with the column companies_id
, and the list columns product
and company
holding the outputs at product and company level.
The columns co2e_lower
and co2e_upper
show the lowest and highest value
of co2_footprint
within the group to which the product was compared, plus
some randomness. Therefore, every benchmark can have different
co2e_lower
and co2e_upper
, because every benchmark can contain a
different set of products.
See also
Other top-level functions:
profile_sector()
,
score_transition_risk()
,
transition_risk_profile()
Other profile functions:
profile_emissions_impl()
,
profile_sector()
,
transition_risk_profile()
Examples
library(tiltToyData)
library(withr)
library(readr, warn.conflicts = FALSE)
local_seed(1)
restore <- options(readr.show_col_types = FALSE)
companies <- read_csv(toy_emissions_profile_any_companies())
products <- read_csv(toy_emissions_profile_products_ecoinvent())
europages_companies <- read_csv(toy_europages_companies())
ecoinvent_activities <- read_csv(toy_ecoinvent_activities())
ecoinvent_europages <- read_csv(toy_ecoinvent_europages())
isic_name <- read_csv(toy_isic_name())
result <- profile_emissions(
companies,
products,
europages_companies = europages_companies,
ecoinvent_activities = ecoinvent_activities,
ecoinvent_europages = ecoinvent_europages,
isic = isic_name
)
#> Warning: Splitting `companies` into 4 chunks.
result |> unnest_product()
#> # A tibble: 456 × 32
#> companies_id company_name country emission_profile benchmark ep_product
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 asteria_megalotom… asteria_meg… austria high all tent
#> 2 asteria_megalotom… asteria_meg… austria high isic_4di… tent
#> 3 asteria_megalotom… asteria_meg… austria high tilt_sub… tent
#> 4 asteria_megalotom… asteria_meg… austria high unit tent
#> 5 asteria_megalotom… asteria_meg… austria high unit_isi… tent
#> 6 asteria_megalotom… asteria_meg… austria high unit_til… tent
#> 7 skarn_gallinule skarn_galli… austria high all sheds, co…
#> 8 skarn_gallinule skarn_galli… austria high isic_4di… sheds, co…
#> 9 skarn_gallinule skarn_galli… austria high tilt_sub… sheds, co…
#> 10 skarn_gallinule skarn_galli… austria high unit sheds, co…
#> # ℹ 446 more rows
#> # ℹ 26 more variables: matched_activity_name <chr>,
#> # matched_reference_product <chr>, unit <chr>, multi_match <lgl>,
#> # matching_certainty <chr>, matching_certainty_company_average <chr>,
#> # tilt_sector <chr>, tilt_subsector <chr>, isic_4digit <chr>,
#> # isic_4digit_name <chr>, company_city <chr>, postcode <chr>, address <chr>,
#> # main_activity <chr>, activity_uuid_product_uuid <chr>, …
result |> unnest_company()
#> # A tibble: 1,728 × 15
#> companies_id company_name country emission_profile_share emission_profile
#> <chr> <chr> <chr> <dbl> <chr>
#> 1 asteria_megalot… asteria_meg… austria 1 high
#> 2 asteria_megalot… asteria_meg… austria 0 medium
#> 3 asteria_megalot… asteria_meg… austria 0 low
#> 4 asteria_megalot… asteria_meg… austria 0 NA
#> 5 asteria_megalot… asteria_meg… austria 1 high
#> 6 asteria_megalot… asteria_meg… austria 0 medium
#> 7 asteria_megalot… asteria_meg… austria 0 low
#> 8 asteria_megalot… asteria_meg… austria 0 NA
#> 9 asteria_megalot… asteria_meg… austria 1 high
#> 10 asteria_megalot… asteria_meg… austria 0 medium
#> # ℹ 1,718 more rows
#> # ℹ 10 more variables: benchmark <chr>,
#> # matching_certainty_company_average <chr>, company_city <chr>,
#> # postcode <chr>, address <chr>, main_activity <chr>,
#> # profile_ranking_avg <dbl>, min_headcount <dbl>, max_headcount <dbl>,
#> # co2_avg <dbl>
inputs <- read_csv(toy_emissions_profile_upstream_products_ecoinvent())
ecoinvent_inputs <- read_csv(toy_ecoinvent_inputs())
result <- profile_emissions_upstream(
companies,
inputs,
europages_companies = europages_companies,
ecoinvent_activities = ecoinvent_activities,
ecoinvent_inputs = ecoinvent_inputs,
ecoinvent_europages = ecoinvent_europages,
isic = isic_name
)
#> Warning: Splitting `companies` into 4 chunks.
result |> unnest_product()
#> # A tibble: 3,966 × 31
#> companies_id company_name country emission_upstream_pr…¹ benchmark ep_product
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 asteria_meg… asteria_meg… austria high all tent
#> 2 asteria_meg… asteria_meg… austria high input_is… tent
#> 3 asteria_meg… asteria_meg… austria high input_ti… tent
#> 4 asteria_meg… asteria_meg… austria high input_un… tent
#> 5 asteria_meg… asteria_meg… austria high input_un… tent
#> 6 asteria_meg… asteria_meg… austria high input_un… tent
#> 7 skarn_galli… skarn_galli… austria high all sheds, co…
#> 8 skarn_galli… skarn_galli… austria high input_is… sheds, co…
#> 9 skarn_galli… skarn_galli… austria high input_ti… sheds, co…
#> 10 skarn_galli… skarn_galli… austria high input_un… sheds, co…
#> # ℹ 3,956 more rows
#> # ℹ abbreviated name: ¹emission_upstream_profile
#> # ℹ 25 more variables: matched_activity_name <chr>,
#> # matched_reference_product <chr>, unit <chr>, multi_match <lgl>,
#> # matching_certainty <chr>, matching_certainty_company_average <chr>,
#> # input_name <chr>, input_unit <chr>, input_tilt_sector <chr>,
#> # input_tilt_subsector <chr>, input_isic_4digit <chr>, …
result |> unnest_company()
#> # A tibble: 1,728 × 13
#> companies_id company_name company_city country emission_upstream_pr…¹
#> <chr> <chr> <chr> <chr> <dbl>
#> 1 asteria_megalotomus… asteria_meg… wilhelmsburg austria 1
#> 2 asteria_megalotomus… asteria_meg… wilhelmsburg austria 0
#> 3 asteria_megalotomus… asteria_meg… wilhelmsburg austria 0
#> 4 asteria_megalotomus… asteria_meg… wilhelmsburg austria 0
#> 5 asteria_megalotomus… asteria_meg… wilhelmsburg austria 1
#> 6 asteria_megalotomus… asteria_meg… wilhelmsburg austria 0
#> 7 asteria_megalotomus… asteria_meg… wilhelmsburg austria 0
#> 8 asteria_megalotomus… asteria_meg… wilhelmsburg austria 0
#> 9 asteria_megalotomus… asteria_meg… wilhelmsburg austria 1
#> 10 asteria_megalotomus… asteria_meg… wilhelmsburg austria 0
#> # ℹ 1,718 more rows
#> # ℹ abbreviated name: ¹emission_upstream_profile_share
#> # ℹ 8 more variables: emission_upstream_profile <chr>, benchmark <chr>,
#> # matching_certainty_company_average <chr>, postcode <chr>, address <chr>,
#> # main_activity <chr>, profile_ranking_avg <dbl>, co2_avg <dbl>
# Cleanup
options(restore)