best-cost / best-cost_WPs

This repository aim to collect the confidential (not public) work of the EU project BEST-COST in the framework of the workpackages (WPs).
1 stars 0 forks source link

Nested tibbles with numbers as instead of names #299

Closed ungatoverde closed 2 months ago

ungatoverde commented 2 months ago

Issue imported from an improvement suggested by @luytax in #148

Name the nested tibbles that are in the "Detailed" function output (see screenshot in comment below)

image

The names() function can be used. E.g: names(output$detailed$interim$lifetable_with_pop_nest) <- c("Male population", "Female population", "Total population", "Total impact") results in:

image

ungatoverde commented 2 months ago

I have fixed this bug in #300.

However, the solution was a bit more complicated than initially planned. Not only sex but other variables can contribute to have multiple nested tables: e.g. geo_id, and all incertainties ending with _ci. And not all variables are always present (depending on user entry data). To solve this, somekind of id was greated colapsing the values with _. Not ideal because you cannnot know if the central estimates refer e.g. to erf or to bhd but at least some kind of indexing are more informative than the number before. Anyway, this is not super important because it only affects the lifetable approach and only when looking at the strcuture in the environment. When clicking directly on the tibble you just see rows (no numbers).