Posts

Colored country maps with ggplot Part 1

Image
After a long absence today an easy guide to print maps with ggplot. First we need a map. As example we use a map of Austria on local community (Gemeinden) level. An ideal data format ist JSON. For Austria one source for this maps is here: https://github.com/ginseng666/GeoJSON-TopoJSON-Austria You can choose between three detail levels. For our needs we can stick with the lowest detail level. So the file we are interested in is: "gemeinden_999_geo.json" What to show? For experimental purposes we use the vaccination rate on local community level, which can be downloaded here. Of course it is crucial to have the same detail level in your data as in your map!: https://info.gesundheitsministerium.at/opendata The file we are looking for is here: https://www.data.gv.at/katalog/dataset/covid-19-schutzimpfungen-impfungen-in-gemeinden/resource/89ad8077-0318-4dfb-953f-0824754b5adc I am not sure if this link is persistent, so you have to look for a file named impfungen-gemeinden.csv As w...

Fun with Flags (in R)

After three entries I thought it was time to show this blog to my sister. After reading (I don't believe you!) all three previous entries, she laconically said "reminds me of fun with flags". I'm not sure if she ment it as a compliment, but since I like "fun with flags", I took it as such.  In any case, that was still better than my two nephews, who made no comment at all. Ignorance is the worst punishment? Although, between Apex Ledgends and Valorant there is really little time for such stupid things as programming. After my sister's hint and the fact that I keep reading questions about geom_image and geom_bar in various forums, the topic today is ... Fun With Flags! Lets visualize some macro economic data today.  First question: Where do we get our data from? From the European Unions Spring 2020 Economic Forecast . We take a look at the debt to gdp ratios for selected countries. We want to display the 2019 debt/GDP ratios in a bar chart and use a flag...