Skip to content

Commit

Permalink
adapted Rmd file to work with tiltIndicatorAfter
Browse files Browse the repository at this point in the history
  • Loading branch information
lindadelacombaz committed Jun 4, 2024
1 parent d4b592c commit 1020b21
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions vignettes/articles/integration-with-tiltIndicator.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ 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
)
```

Apply tilt methodology.
Expand All @@ -57,32 +48,19 @@ result <- profile_emissions(
ecoinvent_activities = ecoinvent_activities,
ecoinvent_europages = ecoinvent_europages,
isic = isic_name
)
```


```{r}
#emissions_profile <- profile_emissions(companies, products)
#at_product_level <- unnest_product(emissions_profile)
```

Adapt the ouput of tiltIindicator to the input of tiltPlot.

```{r}
at_product_level <- at_product_level |>
rename(emission_profile = risk_category, benchmark = grouped_by)
) |>
unnest_product()
```

Visualize all companies.

```{r}
#FIXME: add columns best_case, equal_weight and worst_case to the at_product_level data
#bar_plot_emission_profile(at_product_level, benchmarks = c("all", "unit"), mode = "equal_weight")
bar_plot_emission_profile(result, benchmarks = c("all", "unit"), mode = "equal_weight")
```

Visualize one specific company.

```{r}
#first_company <- filter(at_product_level, companies_id %in% first(companies_id))
#bar_plot_emission_profile(first_company, benchmarks = c("all", "unit"), mode = "equal_weight")
first_company <- filter(result, companies_id %in% first(companies_id))
bar_plot_emission_profile(first_company, benchmarks = c("all", "unit"), mode = "equal_weight")
```

0 comments on commit 1020b21

Please sign in to comment.