ropensci / rnaturalearth

An R package to hold and facilitate interaction with natural earth map data :earth_africa:
http://ropensci.github.io/rnaturalearth/
Other
214 stars 24 forks source link

ISO codes missing for France and Norway #77

Closed eteitelbaum closed 1 year ago

eteitelbaum commented 1 year ago

Earlier it was noted that France was missing from rnaturalearth.

Now, France is there, but its iso_a2 and iso_a3 codes are missing.

library(dplyr)
library(rnaturalearth)

ne_countries(scale = "medium", returnclass = "sf") |>
  filter(name == "France") |>
  select(iso_a2, iso_a3)

This is a known issue that has been flagged on the natural earth github repo, but is probably worth noting here in case people have issues merging data in based on these ISO codes. Personally, I have had some embarrassing experiences presenting maps in class with a missing France. "Uh...uhh...Where's France you ask? Must of, uh...sunk into the Atlantic?"

One solution is to be merge based on iso_a3_eh, which is available. But I am not sure what "eh" stands for and could not find it in the documentation. This makes it harder to use in a classroom setting.

ALL of the ISO codes appear to be missing for Norway including iso_a2, iso_a3, iso_a3_eh, iso_n3, un_a3, wb_a2 and wb_a3.

ne_countries(scale = "medium", returnclass = "sf") |>
  filter(name == "Norway") |>
  select(iso_a2, iso_a3, iso_a3_eh, iso_n3, un_a3, wb_a2, wb_a3)

Thus Norway always ends up getting greyed out in any global choropleth maps I am making (unless of course I manually code in the missing ISO code).

There is a note about missing iso_a2 codes for Norway on the Natural Earth github repo. But I couldn't find an explanation for the other missing codes.

Thanks.

eteitelbaum commented 1 year ago

Seems like this issue has been fixed. Thanks.