Package 'tiltIndicatorAfter'

Title: Create user facing outputs of tiltIndicators
Description: Create user facing outputs of tiltIndicators.
Authors: Kalash Singhal [aut, cre], Mauro Lepore [aut] , Anne Schoenauer [aut] , Tilman Trompke [aut] , Linda Delacombaz [aut], 2 Degrees Investing Initiative [cph, fnd]
Maintainer: Kalash Singhal <[email protected]>
License: GPL (>= 3)
Version: 0.0.0.9062
Built: 2024-10-28 06:21:11 UTC
Source: https://github.com/2DegreesInvesting/tiltIndicatorAfter

Help Index


Profile emissions and upstream emissions

Description

These functions wrap the output of the corresponding function in tiltIndicator.

Usage

profile_emissions(
  companies,
  co2,
  europages_companies,
  ecoinvent_activities,
  ecoinvent_europages,
  isic,
  isic_tilt = lifecycle::deprecated(),
  low_threshold = 1/3,
  high_threshold = 2/3
)

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_europages

Dataframe. Mapper between europages and ecoinvent.

isic

Dataframe. ISIC data.

isic_tilt

[Deprecated]

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.

ecoinvent_inputs

Dataframe. Upstream products from ecoinvent.

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()

Other profile functions: profile_emissions_impl(), profile_sector()

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
)

result |> unnest_product()

result |> unnest_company()



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
)

result |> unnest_product()

result |> unnest_company()

# Cleanup
options(restore)

Profile sector and upstream sector

Description

These functions wrap the output of the corresponding function in tiltIndicator.

Usage

profile_sector(
  companies,
  scenarios,
  europages_companies,
  ecoinvent_activities,
  ecoinvent_europages,
  isic,
  isic_tilt = lifecycle::deprecated(),
  low_threshold = ifelse(scenarios$year == 2030, 1/9, 1/3),
  high_threshold = ifelse(scenarios$year == 2030, 2/9, 2/3)
)

profile_sector_upstream(
  companies,
  scenarios,
  inputs,
  europages_companies,
  ecoinvent_activities,
  ecoinvent_inputs,
  ecoinvent_europages,
  isic,
  isic_tilt = lifecycle::deprecated(),
  low_threshold = ifelse(scenarios$year == 2030, 1/9, 1/3),
  high_threshold = ifelse(scenarios$year == 2030, 2/9, 2/3)
)

Arguments

companies, scenarios, inputs

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_europages

Dataframe. Mapper between europages and ecoinvent.

isic

Dataframe. ISIC data.

isic_tilt

[Deprecated]

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.

ecoinvent_inputs

Dataframe. Upstream products from ecoinvent.

Value

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

See Also

Other top-level functions: profile_emissions()

Other profile functions: profile_emissions(), profile_emissions_impl()

Examples

library(tiltToyData)
library(readr, warn.conflicts = FALSE)

restore <- options(readr.show_col_types = FALSE)

companies <- read_csv(toy_sector_profile_companies())
scenarios <- read_csv(toy_sector_profile_any_scenarios())
europages_companies <- read_csv(toy_europages_companies()) |> head(3)
ecoinvent_activities <- read_csv(toy_ecoinvent_activities()) |> head(3)
ecoinvent_europages <- read_csv(toy_ecoinvent_europages()) |> head(3)
isic_name <- read_csv(toy_isic_name()) |> head(3)

result <- profile_sector(
  companies,
  scenarios,
  europages_companies = europages_companies,
  ecoinvent_activities = ecoinvent_activities,
  ecoinvent_europages = ecoinvent_europages,
  isic = isic_name
)

result |> unnest_product()

result |> unnest_company()



companies <- read_csv(toy_sector_profile_upstream_companies())
scenarios <- read_csv(toy_sector_profile_any_scenarios())
inputs <- read_csv(toy_sector_profile_upstream_products())
europages_companies <- read_csv(toy_europages_companies()) |> head(3)
ecoinvent_activities <- read_csv(toy_ecoinvent_activities()) |> head(3)
ecoinvent_inputs <- read_csv(toy_ecoinvent_inputs()) |> head(3)
ecoinvent_europages <- read_csv(toy_ecoinvent_europages()) |> head(3)
isic_name <- read_csv(toy_isic_name()) |> head(3)

result <- profile_sector_upstream(
  companies,
  scenarios,
  inputs,
  europages_companies = europages_companies,
  ecoinvent_activities = ecoinvent_activities,
  ecoinvent_inputs = ecoinvent_inputs,
  ecoinvent_europages = ecoinvent_europages,
  isic = isic_name
)

result |> unnest_product()

result |> unnest_company()

# Cleanup
options(restore)