Skip to contents

These options are meant to be used mainly by developers or analysts while testing the code or creating data:

  • tiltIndicatorAfter.set_jitter_amount: Controls the amount of random noise in the columns co2*.

  • tiltIndicatorAfter.output_co2_footprint_min_max: Outputs the columns min and max (calculated from co2_footprint), which yield the noisy co2* columns.

  • tiltIndicatorAfter.output_co2_footprint:

    • At product level it outputs licensed column co2_footprint.

    • At company level it outputs the column co2_avg (average co2_footprint by companies_id).

  • tiltIndicatorAfter.verbose: Controls verbosity.

Examples

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

set.seed(1)

restore <- options(list(
  readr.show_col_types = FALSE,
  tiltIndicatorAfter.set_jitter_amount = 1,
  tiltIndicatorAfter.verbose = TRUE,
  tiltIndicatorAfter.output_co2_footprint_min_max = TRUE
))

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() |>
  select(matches(c("min", "max", "co2")))
#> # A tibble: 456 × 6
#>    min_headcount   min max_headcount   max co2e_lower co2e_upper
#>            <dbl> <dbl>         <dbl> <dbl>      <dbl>      <dbl>
#>  1             1  303.            10  303.      161.        550.
#>  2             1  303.            10  303.       33.5       568.
#>  3             1  303.            10  303.      190.        304.
#>  4             1  303.            10  303.      230.        477.
#>  5             1  303.            10  303.      162.        374.
#>  6             1  303.            10  303.      292.        493.
#>  7             1  303.            10  303.      161.        550.
#>  8             1  303.            10  303.       33.5       568.
#>  9             1  303.            10  303.      190.        304.
#> 10             1  303.            10  303.      230.        477.
#> # ℹ 446 more rows

result |>
  unnest_company() |>
  select(matches(c("min", "max", "co2")))
#> # A tibble: 1,728 × 3
#>    min_headcount max_headcount co2_avg
#>            <dbl>         <dbl>   <dbl>
#>  1             1            10    303.
#>  2             1            10    303.
#>  3             1            10    303.
#>  4             1            10    303.
#>  5             1            10    303.
#>  6             1            10    303.
#>  7             1            10    303.
#>  8             1            10    303.
#>  9             1            10    303.
#> 10             1            10    303.
#> # ℹ 1,718 more rows