Closed jdhoffa closed 3 years ago
For the record, as I experimented a bit I came up with this slightly different way to clean the scenario_data
:
data %>%
tidyr::pivot_longer(
where(is.double),
names_to = "year",
names_transform = list(year = as.integer)
) %>%
dplyr::filter(!is.na(value)) %>%
janitor::clean_names() %>%
mutate(across(where(is.character), \(x) gsub(" ", "_", tolower(x)))) %>%
As we changed the dataset, this issue is no longer relevant.
There are a handful of datasets that seem to be important for the tool. From what I can tell so far, they are at least:
scenario_data
andcountries
The
scenario_data
source of truth comes from: https://github.com/2DegreesInvesting/CapitalMarketsPlatform/blob/master/data/scenario_data.rdsThe
countries
seem to be manually defined as vectors in the original code. It might make sense to extract these as individual datasets.Below, I have a sample script that generates the important data that we need from
scenario_data.rds
and the manual country definitions.In #2 for the questions 4.1 and 4.2, you will need the unique values of
countries
andregions
as choices.I don't have a good idea of how/ where to store this information yet, but useful to see for now.
What I include below isn't exactly a reprex, but hopefully it's enough information to get started working.