Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Parse ISO 3166-1 country codes to a Country entity
ResourceFunction["FromISOCountry"][expr] replaces ISO country codes in expr with "Country" entities. | |
ResourceFunction["FromISOCountry"][expr,levelspec] replaces ISO country codes with "Country" entities in parts of expr specified by levelspec. |
Replace an ISO country code with an entity:
In[1]:= | ![]() |
Out[1]= | ![]() |
Replace country codes in a List with entities:
In[2]:= | ![]() |
Out[2]= | ![]() |
Specify the levelspec to replace only certain levels:
In[3]:= | ![]() |
Out[3]= | ![]() |
You can specify to use the three-character ISO3 format instead using "CountryFormat":
In[4]:= | ![]() |
Out[4]= | ![]() |
Convert country codes in a Dataset to their respective Entity forms:
In[5]:= | ![]() |
Out[5]= | ![]() |
In[6]:= | ![]() |
Out[6]= | ![]() |
Visualize the data with GeoRegionValuePlot:
In[7]:= | ![]() |
Out[7]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License