You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi... my apologies for not replying sooner than this... The end of Sept was a very busy time for me, so I must have missed this...
Namibia's iso2c code has been a source of many problems... I just tried the examples you provided and it seemed to have worked as expected. Can you confirm that you are still seeing this issue? If so would you mind providing the output of sessionInfo()
Thanks!
library(wbstats)
library(tidyverse)
#> Warning: package 'tidyverse' was built under R version 3.6.3#> Warning: package 'tibble' was built under R version 3.6.3#> Warning: package 'tidyr' was built under R version 3.6.3#> Warning: package 'purrr' was built under R version 3.6.1#> Warning: package 'dplyr' was built under R version 3.6.3#> Warning: package 'forcats' was built under R version 3.6.3
wb_data("countries_only",
indicator= c("SP.POP.TOTL", "SP.URB.TOTL"),
mrv=1,
gapfill=TRUE, return_wide=TRUE) %>%
left_join(wb_cachelist$countries[, c('iso3c','region')], by= c('iso3c')) %>%
filter(iso3c=="NAM")
#> # A tibble: 1 x 7#> iso2c iso3c country date SP.POP.TOTL SP.URB.TOTL region #> <chr> <chr> <chr> <dbl> <dbl> <dbl> <chr> #> 1 NA NAM Namibia 2020 2494530 1273258 Sub-Saharan Africa
wb_data("countries_only",
indicator= c("SP.POP.TOTL", "SP.URB.TOTL"),
mrv=1,
gapfill=TRUE, return_wide=TRUE) %>%
left_join(wb_cachelist$countries[, c('iso2c','region')], by= c('iso2c')) %>%
filter(iso3c=="NAM")
#> # A tibble: 1 x 7#> iso2c iso3c country date SP.POP.TOTL SP.URB.TOTL region #> <chr> <chr> <chr> <dbl> <dbl> <dbl> <chr> #> 1 NA NAM Namibia 2020 2494530 1273258 Sub-Saharan Africa
Namibia's iso2c code is "NA", but wb_data returns missing instead of the string. Hence, you cannot merge on it.
The text was updated successfully, but these errors were encountered: