Calculate the descriptive analysis of co2_footprint per grouping_emission
Source:R/calculate_co2_descriptive_analysis_per_benchmark.R
calculate_co2_descriptive_analysis_per_benchmark.Rd
This function calculates the descriptive analysis of co2_footprint per grouping_emission using product-level output of Emissions profile indicator.
Examples
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
emission_product_example <- example_emission_product_co2_des_analysis()
emission_product_example
#> # A tibble: 8 × 8
#> grouping_emission tilt_sector tilt_subsector unit isic_4digit co2_footprint
#> <chr> <chr> <chr> <chr> <chr> <dbl>
#> 1 tilt_subsector group chemicals kg '5555' 1
#> 2 tilt_subsector group chemicals kg '5555' 4
#> 3 tilt_subsector group chemicals kg '5555' 9
#> 4 tilt_subsector group chemicals kg '5555' 8
#> 5 tilt_subsector group chemicals kg '5555' NA
#> 6 tilt_subsector group iron & steel m3 '6666' 1
#> 7 tilt_subsector group iron & steel m3 '6666' 2
#> 8 tilt_subsector group iron & steel m3 '6666' 4
#> # ℹ 2 more variables: product <chr>, activity_uuid_product_uuid <chr>
# Calculates the descriptive analysis for grouping_emission "tilt_subsector"
calculate_co2_descriptive_analysis_per_benchmark(
emission_product_example,
"tilt_subsector"
)
#> # A tibble: 2 × 7
#> tilt_sector tilt_subsector `# of distinct products` `min CO2e` `max CO2e`
#> <chr> <chr> <int> <dbl> <dbl>
#> 1 group chemicals 5 1 9
#> 2 group iron & steel 3 1 4
#> # ℹ 2 more variables: `mean CO2e` <dbl>, `median CO2e` <dbl>