Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.0 query updates #30

Open
whitenightZhang opened this issue Jun 6, 2024 · 1 comment
Open

7.0 query updates #30

whitenightZhang opened this issue Jun 6, 2024 · 1 comment

Comments

@whitenightZhang
Copy link

Due to the 7.0 economic system update, the current query is not able to query economic system parameters such as gdp properly (haven't tried to see if this will also affect other queries).

@pralitp
Copy link
Contributor

pralitp commented Jun 6, 2024

We should check all queries which may need updating.

GDP in particular is a bit more complicated due to the new Macro module introduced in GCAM 7.

The following is a good work around for the moment to get the GDP from the market query:

market_price_query = get_query("market", "price")
gdp_market = get_data(g, market_price_query, list("market" = c("=~", "GDP_Trial")))
gdp_region = gdp_market %>%
    mutate(region = gsub("GDP_Trial", "", market)) %>%
    select(region, year = `market-period`, gdp = price)
print(head(gdp_region))

Which produces:

# A tibble: 6 × 3
  region          year    gdp
  <chr>          <int>  <dbl>
1 Africa_Eastern  1975  28893
2 Africa_Eastern  1990  46850
3 Africa_Eastern  2005  85953
4 Africa_Eastern  2010 119402
5 Africa_Eastern  2015 151679
6 Africa_Eastern  2020 187112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants