Closed chriscarrollsmith closed 4 days ago
Is it ok if I first create the ids_list_geographies() function and your PR includes updating it with the standardization using the new micropackage? That is, I'd rewrite and close this issue first: https://github.com/Teal-Insights/r-wbids/issues/11
Yep, feel free!
Package is published here:
https://github.com/Teal-Insights/stdgeography
It imports a "standardized_geographies" dataframe in tidy format, with "country_name", "country_group", and "group_type" columns. "group_type" is either "IMF" or "World Bank". The API here will change, especially as you figure out exactly what you need this mapping to look like and to do, but I figured I'd make a minimum version available to start playing with.
Okay, so the only dataframe I've exported from this package so far is the mapping of countries to aggregates, which is not actually what we need. What we need is the mapping of WB countries to Teal Insights countries, and of World Bank aggregates to Teal Insights aggregates, correct? I will work on exporting that next.
We currently have geography_id (which are ISO3 codes) + geography_name and counterpart_id (which are some character IDs in the form of e.g. "002") + counterpart_name (which sometimes has different spelling for the same country from the geographies table). However, counterparts can also be institutions in addition to countries and regions.
Ideally, we need a table with entity_id and entity_name, where entity_id contains both geography_id and counterpart_id and thus some countries or regions multiple times. Then we can add other columns like ISO2, ISO3, entity_type, entity_group etc.
Since the package will hence not only geographies, but also institutions, maybe we can give it a better name that reflects this fact? First things that come to my mind: "globalentities" or "macroentities"
Hah! What a mess. Okay, that's helpful; thanks. I think I've identified a .csv Teal constructed in one of his other projects that provides most of what we want. I'll probably export both dataframes and conversion functions (for identifiers that have a one-to-one rather than one-to-many mapping).
The concept of geography is definitely expansive enough to include institutions, but I don't hate "macroentities" since it communicates that this is a macroecon package. Not gonna worry too much about package name right now though; not too hard to rename later in consultation with Teal.
@christophscheuch I really like what you've done in constructing your wbwdi
package's geography mapping. You're already most of the way there!
I'll talk with @chriscarrollsmith about this tomorrow.
You two are getting a lot done! I love it
@christophscheuch I really like what you've done in constructing your
wbwdi
package's geography mapping. You're already most of the way there!
I guess with a few lines of manual mapping of counterpart areas to WDI names and googling some ISO codes we could be done. That's probably how I'd take it from there, but I don't have much experience with these entities 😄
@chriscarrollsmith can I support you in any way with r-econids? From my perspective, its integration is the last piece that we need for a r-wbids 0.1.0 version that we could prepare for a CRAN release. Teal and I discussed today that it makes sense to publish the download functionality first and then figure out which other helpers / features to add as we approach version 1.0.0.
@chriscarrollsmith can I support you in any way with r-econids? From my perspective, its integration is the last piece that we need for a r-wbids 0.1.0 version that we could prepare for a CRAN release. Teal and I discussed today that it makes sense to publish the download functionality first and then figure out which other helpers / features to add as we approach version 1.0.0.
Yes, sorry; I didn't realize this was acting as a bottleneck. Give me a couple hours with https://github.com/Teal-Insights/r-econid/issues/15 and I will see if I can get a table mapping imported to r-wbids. Also feel free to open an issue over there or to dive into an existing issue for whatever other functionality you're looking for. My understanding from a conversation I had with Teal yesterday is that mapping Counterpart IDs to ISO3 codes is the main thing you're looking for, but if there are other pain points you need this package to solve, please bring me up to speed on what those are!
No worries, I was just checking in :) How about you finish including table mapping that you have in mind and you just tag me in the PR later? I'll then play around with it in the IDS and WDI contexts 🎮
Feel free to take over on this one as soon as the PR in the other repo is approved and merged.
Geography micro package for mapping Teal geography standard to other ISO standards