Skip to content

Commit

Permalink
Merge pull request #53 from Teal-Insights/52-update-available-geograp…
Browse files Browse the repository at this point in the history
…hies-and-counterparts-to-2023-data

Update sysdata.rda to new IDS release
  • Loading branch information
t-emery authored Dec 5, 2024
2 parents 35a94fd + 355d926 commit 680f432
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Binary file modified R/sysdata.rda
Binary file not shown.
19 changes: 15 additions & 4 deletions data-raw/wbids-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,20 @@ geographies_wdi <- geographies_raw[[2]] |>
geography_type = if_else(
.data$region_name == "Aggregates", "Region", "Country"
),
across(where(is.character), ~ if_else(.x == "", NA, .x)),
region_id = if_else(
.data$region_name == "Aggregates", NA_character_, .data$region_id
),
region_iso2code = if_else(
.data$region_name == "Aggregates", NA_character_, .data$region_iso2code
),
income_level_id = if_else(
.data$region_name == "Aggregates", NA_character_, .data$income_level_id
),
income_level_iso2code = if_else(
.data$region_name == "Aggregates", NA_character_,
.data$income_level_iso2code
),
across(where(is.character), ~ if_else(.x == "", NA_character_, .x)),
across(where(is.character), ~ trimws(gsub("\u00a0", "", .x)))
) |>
relocate(c("geography_type", "capital_city"), .after = "geography_iso2code")
Expand Down Expand Up @@ -264,9 +277,7 @@ counterparts <- counterparts_ids_cleaned |>
counterpart_name %in% global_mdbs ~ "Global MDBs",
counterpart_name %in% c("Bondholders") ~ "Bondholders",
counterpart_name %in% c("World") ~ "All Creditors",
geography_type == "Country" ~ "Country",
geography_type == "Region" ~ "Region",
.default = "Other"
.default = geography_type
)
) |>
select(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-ids_bulk.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ test_that("ids_bulk handles warn_size parameter", {
download_bulk_file(
test_url, tempfile(), 60, warn_size = TRUE, quiet = TRUE
),
"This file is 125.8 MB and may take several minutes to download",
"may take several minutes to download",
fixed = FALSE
)

Expand Down

0 comments on commit 680f432

Please sign in to comment.