I am working on a workshop for Business Analytics masters students. Part of the demos I intend to use are geographical visualizations. I am using rworldmap package to achieve these.
Let us say you have geographical data in a data.frame such as country, with country identifiers stored in “ip_iso2” column in ISO2 format and the variable of interest in “Supply” column. You plot this data as:
# Convert your data to a map that rworldmap can render country
country<- joinCountryData2Map(country, joinCode = "ISO2", nameJoinColumn = 'ip_iso2', verbose = T)
# Render the map
mapCountryData(country, nameColumnToPlot = "Supply")
Result would looke like this:
A fancier example would be having a third grouping variable such as “Those” in a column.
# Initialize the map
# Populate the map(, and change colors of land and oceans)
mapBubbles(dF=country, nameZSize="Supply", nameZColour="Those", colourPalette="rainbow", oceanCol="lightblue", landCol="wheat")
And this would be the result of this effort.