Happy EasteR: Plotting hare populations in Germany

[This article was first published on Shirin's playgRound, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

For Easter, I wanted to have a look at the number of hares in Germany. Wild hare populations have been rapidly declining over the last 10 years but during the last three years they have at least been stable.

This plot shows the 16 federal states of Germany. Their fill color shows the proportion of hares per square kilometer in 2015/2016. The black area of the pie charts shows the percentage of the total number of hares (not corrected by area) for each federal state in regard to the total number of hares in all of Germany during that time. The size of the hares in the background reflects the total number of hares in the eight federal states with the highest percentages.

Below, you can find the code I used to produce this plot.


Hare population numbers

The German hunter’s association (Deutscher Jagdverband) publishes population numbers for a variety of common species of wild game, including hares. The most recent numbers are for the year 2015/16.

I downloaded the pdf and extracted the table on page 1 with the tabulizer package.

<span class="n">library</span><span class="p">(</span><span class="n">tidyverse</span><span class="p">)</span><span class="w">
</span>
<span class="c1">#devtools::install_github("ropensci/tabulizer")
</span><span class="n">library</span><span class="p">(</span><span class="n">tabulizer</span><span class="p">)</span><span class="w">

</span><span class="n">txt</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">extract_tables</span><span class="p">(</span><span class="s2">"2015-16 Jahresstrecke Feldhase.pdf"</span><span class="p">)</span><span class="w">

</span><span class="n">hares</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">txt</span><span class="p">[[</span><span class="m">1</span><span class="p">]]</span><span class="w"> </span><span class="o">%>%</span><span class="w">
  </span><span class="n">as.data.frame</span><span class="p">(</span><span class="n">stringsAsFactors</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">FALSE</span><span class="p">)</span><span class="w">

</span><span class="c1"># first row contains column names, remove from df and set as colnames
</span><span class="n">hares_df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">data.frame</span><span class="p">(</span><span class="n">hares</span><span class="p">[</span><span class="m">-1</span><span class="w"> </span><span class="p">,</span><span class="w"> </span><span class="p">])</span><span class="w">
</span><span class="n">colnames</span><span class="p">(</span><span class="n">hares_df</span><span class="p">)</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">gsub</span><span class="p">(</span><span class="s2">" "</span><span class="p">,</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w"> </span><span class="nf">as.character</span><span class="p">(</span><span class="nf">c</span><span class="p">(</span><span class="s2">"bundesland"</span><span class="p">,</span><span class="w"> </span><span class="n">unlist</span><span class="p">(</span><span class="n">hares</span><span class="p">[</span><span class="m">1</span><span class="p">,</span><span class="w"> </span><span class="m">-1</span><span class="p">]))))</span><span class="w">

</span><span class="c1"># remove the spaces in the numbers and make numeric
</span><span class="n">hares_df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">apply</span><span class="p">(</span><span class="n">hares_df</span><span class="p">,</span><span class="w"> </span><span class="m">2</span><span class="p">,</span><span class="w"> </span><span class="k">function</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="n">gsub</span><span class="p">(</span><span class="s2">" "</span><span class="p">,</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w">
</span><span class="n">hares_df</span><span class="p">[,</span><span class="w"> </span><span class="m">-1</span><span class="p">]</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">apply</span><span class="p">(</span><span class="n">hares_df</span><span class="p">[,</span><span class="w"> </span><span class="m">-1</span><span class="p">],</span><span class="w"> </span><span class="m">2</span><span class="p">,</span><span class="w"> </span><span class="k">function</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="nf">as.numeric</span><span class="p">(</span><span class="n">x</span><span class="p">))</span><span class="w">

</span><span class="n">hare_final</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">as.data.frame</span><span class="p">(</span><span class="n">hares_df</span><span class="p">,</span><span class="w"> </span><span class="n">stringsAsFactors</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">FALSE</span><span class="p">)</span><span class="w">
</span>

The map

I downloaded the ESRI Shapefile of German federal states from the Bundesamt für Kartographie und Geodäsie, Frankfurt am Main, 2011 and read it in with the rgdal package.

<span class="n">library</span><span class="p">(</span><span class="n">maptools</span><span class="p">)</span><span class="w">

</span><span class="n">ger</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">rgdal</span><span class="o">::</span><span class="n">readOGR</span><span class="p">(</span><span class="n">dsn</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"shp"</span><span class="p">,</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"vg2500_bld"</span><span class="p">)</span><span class="w">
</span>
## OGR data source with driver: ESRI Shapefile 
## Source: "shp", layer: "vg2500_bld"
## with 16 features
## It has 6 fields

I then convert the shapefile into a dataframe for plotting. This allowes the plotting of polygons in the shape of ech federal state with ggplot.

<span class="n">library</span><span class="p">(</span><span class="n">plyr</span><span class="p">)</span><span class="w">
</span><span class="n">ger_df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">fortify</span><span class="p">(</span><span class="n">ger</span><span class="p">)</span><span class="w">
</span><span class="n">ger</span><span class="o">@</span><span class="n">data</span><span class="o">$</span><span class="n">id</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">rownames</span><span class="p">(</span><span class="n">ger</span><span class="o">@</span><span class="n">data</span><span class="p">)</span><span class="w">
</span><span class="n">ger_df_final</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">join</span><span class="p">(</span><span class="n">ger_df</span><span class="p">,</span><span class="w"> </span><span class="n">ger</span><span class="o">@</span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="n">by</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"id"</span><span class="p">)</span><span class="w">
</span><span class="n">ger_df_final</span><span class="o">$</span><span class="n">GEN</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">as.character</span><span class="p">(</span><span class="n">ger_df_final</span><span class="o">$</span><span class="n">GEN</span><span class="p">)</span><span class="w">
</span><span class="n">ger_df_final</span><span class="o">$</span><span class="n">GEN</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">gsub</span><span class="p">(</span><span class="s2">"\xfc"</span><span class="p">,</span><span class="w"> </span><span class="s2">"ü"</span><span class="p">,</span><span class="w"> </span><span class="n">ger_df_final</span><span class="o">$</span><span class="n">GEN</span><span class="p">)</span><span class="w">
</span><span class="n">ger_df_final</span><span class="o">$</span><span class="n">GEN</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">gsub</span><span class="p">(</span><span class="s2">"ü"</span><span class="p">,</span><span class="w"> </span><span class="s2">"ue"</span><span class="p">,</span><span class="w"> </span><span class="n">ger_df_final</span><span class="o">$</span><span class="n">GEN</span><span class="p">)</span><span class="w">
</span>

To match the names of the federal states in the map dataframe with the hare population table, I assign a corresponding column to the latter.

<span class="n">hare_final2</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">filter</span><span class="p">(</span><span class="n">hare_final</span><span class="p">,</span><span class="w"> </span><span class="n">bundesland</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="s2">"gesamt"</span><span class="p">)</span><span class="w">
</span><span class="n">hare_final2</span><span class="o">$</span><span class="n">GEN</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">as.factor</span><span class="p">(</span><span class="nf">c</span><span class="p">(</span><span class="s2">"Baden-Wuerttemberg"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Bayern"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Berlin"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Brandenburg"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Bremen"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Hamburg"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Hessen"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Mecklenburg-Vorpommern"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Niedersachsen"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Nordrhein-Westfalen"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Rheinland-Pfalz"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Saarland"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Sachsen"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Sachsen-Anhalt"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Schleswig-Holstein"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Thueringen"</span><span class="p">))</span><span class="w">
</span><span class="n">colnames</span><span class="p">(</span><span class="n">hare_final2</span><span class="p">)[</span><span class="m">2</span><span class="o">:</span><span class="m">12</span><span class="p">]</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">paste0</span><span class="p">(</span><span class="s2">"Y_"</span><span class="p">,</span><span class="w"> </span><span class="n">gsub</span><span class="p">(</span><span class="s2">"/"</span><span class="p">,</span><span class="w"> </span><span class="s2">"_"</span><span class="p">,</span><span class="w"> </span><span class="n">colnames</span><span class="p">(</span><span class="n">hare_final</span><span class="p">)[</span><span class="m">2</span><span class="o">:</span><span class="m">12</span><span class="p">]))</span><span class="w">

</span><span class="n">hare_final2</span><span class="p">[,</span><span class="w"> </span><span class="m">2</span><span class="o">:</span><span class="m">12</span><span class="p">]</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">apply</span><span class="p">(</span><span class="n">hare_final2</span><span class="p">[,</span><span class="w"> </span><span class="m">2</span><span class="o">:</span><span class="m">12</span><span class="p">],</span><span class="w"> </span><span class="m">2</span><span class="p">,</span><span class="w"> </span><span class="k">function</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="nf">as.numeric</span><span class="p">(</span><span class="n">x</span><span class="p">))</span><span class="w">
</span>

Area

The hare population numbers are given as absolute numbers but I want them normalized by area. The German statistics portal (http://www.statistik-portal.de) provides this data on their website. I use the XML package to scrape it from there.

<span class="n">library</span><span class="p">(</span><span class="n">XML</span><span class="p">)</span><span class="w">
</span><span class="n">table</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">readHTMLTable</span><span class="p">(</span><span class="s2">"http://www.statistik-portal.de/Statistik-Portal/de_jb01_jahrtab1.asp"</span><span class="p">,</span><span class="w"> </span><span class="n">header</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">TRUE</span><span class="p">,</span><span class="w"> </span><span class="n">which</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">1</span><span class="p">,</span><span class="w"> </span><span class="n">stringsAsFactors</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">FALSE</span><span class="p">)</span><span class="w">

</span><span class="n">table</span><span class="o">$</span><span class="n">V</span><span class="m">1</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">gsub</span><span class="p">(</span><span class="s2">"ü"</span><span class="p">,</span><span class="w"> </span><span class="s2">"ü"</span><span class="p">,</span><span class="w"> </span><span class="n">table</span><span class="o">$</span><span class="n">V</span><span class="m">1</span><span class="p">)</span><span class="w">
</span><span class="n">colnames</span><span class="p">(</span><span class="n">table</span><span class="p">)</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">c</span><span class="p">(</span><span class="s2">"GEN"</span><span class="p">,</span><span class="w"> </span><span class="s2">"area"</span><span class="p">,</span><span class="w"> </span><span class="s2">"pop_total"</span><span class="p">,</span><span class="w"> </span><span class="s2">"pop_male"</span><span class="p">,</span><span class="w"> </span><span class="s2">"pop_female"</span><span class="p">,</span><span class="w"> </span><span class="s2">"inh_p_km2"</span><span class="p">)</span><span class="w">

</span><span class="c1"># numbers are in German format, so need to convert them to English decimal notation
</span><span class="n">table</span><span class="p">[,</span><span class="w"> </span><span class="m">-1</span><span class="p">]</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">apply</span><span class="p">(</span><span class="n">table</span><span class="p">[,</span><span class="w"> </span><span class="m">-1</span><span class="p">],</span><span class="w"> </span><span class="m">2</span><span class="p">,</span><span class="w"> </span><span class="k">function</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="nf">as.numeric</span><span class="p">(</span><span class="n">gsub</span><span class="p">(</span><span class="s2">","</span><span class="p">,</span><span class="w"> </span><span class="s2">"."</span><span class="p">,</span><span class="w"> </span><span class="n">gsub</span><span class="p">(</span><span class="s2">"\\."</span><span class="p">,</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))))</span><span class="w">

</span><span class="n">table</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">table</span><span class="p">[</span><span class="m">-17</span><span class="p">,</span><span class="w"> </span><span class="p">]</span><span class="w">
</span><span class="n">table</span><span class="o">$</span><span class="n">GEN</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">as.factor</span><span class="p">(</span><span class="n">table</span><span class="o">$</span><span class="n">GEN</span><span class="p">)</span><span class="w">
</span>

I then divide each population number by area (in km2).

<span class="n">hare_final2</span><span class="o">$</span><span class="n">GEN</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">as.character</span><span class="p">(</span><span class="n">hare_final2</span><span class="o">$</span><span class="n">GEN</span><span class="p">)</span><span class="w">
</span><span class="n">table</span><span class="o">$</span><span class="n">GEN</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">hare_final2</span><span class="o">$</span><span class="n">GEN</span><span class="w">

</span><span class="n">hare_final3</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">hare_final2</span><span class="w"> </span><span class="o">%>%</span><span class="w">
  </span><span class="n">left_join</span><span class="p">(</span><span class="n">table</span><span class="p">,</span><span class="w"> </span><span class="n">by</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"GEN"</span><span class="p">)</span><span class="w">

</span><span class="n">hare_final3</span><span class="p">[,</span><span class="w"> </span><span class="m">2</span><span class="o">:</span><span class="m">12</span><span class="p">]</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">apply</span><span class="p">(</span><span class="n">hare_final3</span><span class="p">[,</span><span class="w"> </span><span class="m">2</span><span class="o">:</span><span class="m">12</span><span class="p">],</span><span class="w"> </span><span class="m">2</span><span class="p">,</span><span class="w"> </span><span class="k">function</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">hare_final3</span><span class="o">$</span><span class="n">area</span><span class="p">)</span><span class="w">
</span>

This final table I then join with the map dataframe.

<span class="n">map</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">left_join</span><span class="p">(</span><span class="n">ger_df_final</span><span class="p">,</span><span class="w"> </span><span class="n">hare_final3</span><span class="p">,</span><span class="w"> </span><span class="n">by</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"GEN"</span><span class="p">)</span><span class="w">
</span>

The background map

The background map shows Germany’s federal states (as polygons) colored according to how many hares there were relative to the area in km2.

I define the mapping theme for ggplot, so that I have no axes, grids, etc. and a transparent background.

<span class="n">map_theme</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">list</span><span class="p">(</span><span class="n">theme</span><span class="p">(</span><span class="n">panel.grid.minor</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_blank</span><span class="p">(),</span><span class="w">
                        </span><span class="n">panel.grid.major</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_blank</span><span class="p">(),</span><span class="w">
                        </span><span class="n">panel.background</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_rect</span><span class="p">(</span><span class="n">fill</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"transparent"</span><span class="p">,</span><span class="w"> </span><span class="n">color</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">NA</span><span class="p">),</span><span class="w">
                        </span><span class="n">plot.background</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_rect</span><span class="p">(</span><span class="n">fill</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"transparent"</span><span class="p">,</span><span class="w"> </span><span class="n">color</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">NA</span><span class="p">),</span><span class="w">
                        </span><span class="n">panel.border</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_blank</span><span class="p">(),</span><span class="w">
                        </span><span class="n">axis.line</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_blank</span><span class="p">(),</span><span class="w">
                        </span><span class="n">axis.text.x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_blank</span><span class="p">(),</span><span class="w">
                        </span><span class="n">axis.text.y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_blank</span><span class="p">(),</span><span class="w">
                        </span><span class="n">axis.ticks</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_blank</span><span class="p">(),</span><span class="w">
                        </span><span class="n">axis.title.x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_blank</span><span class="p">(),</span><span class="w">
                        </span><span class="n">axis.title.y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_blank</span><span class="p">(),</span><span class="w">
                        </span><span class="n">plot.title</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">element_text</span><span class="p">(</span><span class="n">size</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">18</span><span class="p">)))</span><span class="w">
</span>

The background of each polygon is also filled with a hare image with the hare’s size being proportional to the percentage of total hare numbers of each federal state compared to the total number of hares in Germany in 2015/16.

To achieve this, I first downloaded an open-source image of a rabbit and read it with the png package. This image I then want to plot with gplot’s annotation_custom() function, so I need to convert the image to a raster.

<span class="n">library</span><span class="p">(</span><span class="n">png</span><span class="p">)</span><span class="w">
</span><span class="n">bunny</span><span class="w"> </span><span class="o"><-</span><span class="w">  </span><span class="n">readPNG</span><span class="p">(</span><span class="s2">"rabbit-297212_1280.png"</span><span class="p">)</span><span class="w"> </span><span class="c1">#https://pixabay.com
</span><span class="w">
</span><span class="n">library</span><span class="p">(</span><span class="n">grid</span><span class="p">)</span><span class="w">
</span><span class="n">g</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">rasterGrob</span><span class="p">(</span><span class="n">bunny</span><span class="p">,</span><span class="w"> </span><span class="n">interpolate</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">TRUE</span><span class="p">)</span><span class="w">
</span>

I am plotting hares only for the 8 federal states with percentage above 1, because the other ones would be too small on the plot.

For each of these 8 federal states, I am plotting the hare image in relative size by scaling the xmax and ymax values according to the percentage values for each state. The image canvas always has a size of 15 by 15, so I am centering the images at 7.5. I then save each image as a png with transparent background.

<span class="n">val</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">round</span><span class="p">(</span><span class="n">filter</span><span class="p">(</span><span class="n">hare_final_pie</span><span class="p">,</span><span class="w"> </span><span class="n">GEN</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s2">"Bayern"</span><span class="p">)</span><span class="o">$</span><span class="n">percent</span><span class="p">,</span><span class="w"> </span><span class="n">digits</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="m">0.5</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="m">2</span><span class="w">

</span><span class="n">df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">data.frame</span><span class="p">(</span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">)</span><span class="w">

</span><span class="n">qplot</span><span class="p">(</span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="n">geom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"blank"</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">annotation_custom</span><span class="p">(</span><span class="n">g</span><span class="p">,</span><span class="w"> </span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmin</span><span class="p">,</span><span class="w"> </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmax</span><span class="p">,</span><span class="w"> </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymin</span><span class="p">,</span><span class="w"> </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymax</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">map_theme</span><span class="w">
</span><span class="n">ggsave</span><span class="p">(</span><span class="s2">"my_image_Bayern.png"</span><span class="p">,</span><span class="w"> </span><span class="n">bg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"transparent"</span><span class="p">)</span><span class="w">
</span>
<span class="n">val</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">round</span><span class="p">(</span><span class="n">filter</span><span class="p">(</span><span class="n">hare_final_pie</span><span class="p">,</span><span class="w"> </span><span class="n">GEN</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s2">"Niedersachsen"</span><span class="p">)</span><span class="o">$</span><span class="n">percent</span><span class="p">,</span><span class="w"> </span><span class="n">digits</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="m">0.5</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="m">2</span><span class="w">

</span><span class="n">df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">data.frame</span><span class="p">(</span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">)</span><span class="w">

</span><span class="n">qplot</span><span class="p">(</span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="n">geom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"blank"</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">annotation_custom</span><span class="p">(</span><span class="n">g</span><span class="p">,</span><span class="w"> </span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmin</span><span class="p">,</span><span class="w"> </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmax</span><span class="p">,</span><span class="w"> </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymin</span><span class="p">,</span><span class="w"> </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymax</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">map_theme</span><span class="w">
</span><span class="n">ggsave</span><span class="p">(</span><span class="s2">"my_image_Niedersachsen.png"</span><span class="p">,</span><span class="w"> </span><span class="n">bg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"transparent"</span><span class="p">)</span><span class="w">
</span>
<span class="n">val</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">round</span><span class="p">(</span><span class="n">filter</span><span class="p">(</span><span class="n">hare_final_pie</span><span class="p">,</span><span class="w"> </span><span class="n">GEN</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s2">"Nordrhein-Westfalen"</span><span class="p">)</span><span class="o">$</span><span class="n">percent</span><span class="p">,</span><span class="w"> </span><span class="n">digits</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="m">0.5</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="m">2</span><span class="w">

</span><span class="n">df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">data.frame</span><span class="p">(</span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">)</span><span class="w">

</span><span class="n">qplot</span><span class="p">(</span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="n">geom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"blank"</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">annotation_custom</span><span class="p">(</span><span class="n">g</span><span class="p">,</span><span class="w"> </span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmin</span><span class="p">,</span><span class="w"> </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmax</span><span class="p">,</span><span class="w"> </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymin</span><span class="p">,</span><span class="w"> </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymax</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">map_theme</span><span class="w">
</span><span class="n">ggsave</span><span class="p">(</span><span class="s2">"my_image_Nordrhein-Westfalen.png"</span><span class="p">,</span><span class="w"> </span><span class="n">bg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"transparent"</span><span class="p">)</span><span class="w">
</span>
<span class="n">val</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">round</span><span class="p">(</span><span class="n">filter</span><span class="p">(</span><span class="n">hare_final_pie</span><span class="p">,</span><span class="w"> </span><span class="n">GEN</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s2">"Schleswig-Holstein"</span><span class="p">)</span><span class="o">$</span><span class="n">percent</span><span class="p">,</span><span class="w"> </span><span class="n">digits</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="m">0.5</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="m">2</span><span class="w">

</span><span class="n">df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">data.frame</span><span class="p">(</span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">)</span><span class="w">

</span><span class="n">qplot</span><span class="p">(</span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="n">geom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"blank"</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">annotation_custom</span><span class="p">(</span><span class="n">g</span><span class="p">,</span><span class="w"> </span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmin</span><span class="p">,</span><span class="w"> </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmax</span><span class="p">,</span><span class="w"> </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymin</span><span class="p">,</span><span class="w"> </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymax</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">map_theme</span><span class="w">
</span><span class="n">ggsave</span><span class="p">(</span><span class="s2">"my_image_Schleswig-Holstein.png"</span><span class="p">,</span><span class="w"> </span><span class="n">bg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"transparent"</span><span class="p">)</span><span class="w">
</span>
<span class="n">val</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">round</span><span class="p">(</span><span class="n">filter</span><span class="p">(</span><span class="n">hare_final_pie</span><span class="p">,</span><span class="w"> </span><span class="n">GEN</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s2">"Baden-Wuerttemberg"</span><span class="p">)</span><span class="o">$</span><span class="n">percent</span><span class="p">,</span><span class="w"> </span><span class="n">digits</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="m">0.5</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="m">2</span><span class="w">

</span><span class="n">df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">data.frame</span><span class="p">(</span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">)</span><span class="w">

</span><span class="n">qplot</span><span class="p">(</span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="n">geom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"blank"</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">annotation_custom</span><span class="p">(</span><span class="n">g</span><span class="p">,</span><span class="w"> </span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmin</span><span class="p">,</span><span class="w"> </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmax</span><span class="p">,</span><span class="w"> </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymin</span><span class="p">,</span><span class="w"> </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymax</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">map_theme</span><span class="w">
</span><span class="n">ggsave</span><span class="p">(</span><span class="s2">"my_image_Baden-Wuerttemberg.png"</span><span class="p">,</span><span class="w"> </span><span class="n">bg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"transparent"</span><span class="p">)</span><span class="w">
</span>
<span class="n">val</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">round</span><span class="p">(</span><span class="n">filter</span><span class="p">(</span><span class="n">hare_final_pie</span><span class="p">,</span><span class="w"> </span><span class="n">GEN</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s2">"Hessen"</span><span class="p">)</span><span class="o">$</span><span class="n">percent</span><span class="p">,</span><span class="w"> </span><span class="n">digits</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="m">0.5</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="m">2</span><span class="w">

</span><span class="n">df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">data.frame</span><span class="p">(</span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">)</span><span class="w">

</span><span class="n">qplot</span><span class="p">(</span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="n">geom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"blank"</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">annotation_custom</span><span class="p">(</span><span class="n">g</span><span class="p">,</span><span class="w"> </span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmin</span><span class="p">,</span><span class="w"> </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmax</span><span class="p">,</span><span class="w"> </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymin</span><span class="p">,</span><span class="w"> </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymax</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">map_theme</span><span class="w">
</span><span class="n">ggsave</span><span class="p">(</span><span class="s2">"my_image_Hessen.png"</span><span class="p">,</span><span class="w"> </span><span class="n">bg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"transparent"</span><span class="p">)</span><span class="w">
</span>
<span class="n">val</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="nf">round</span><span class="p">(</span><span class="n">filter</span><span class="p">(</span><span class="n">hare_final_pie</span><span class="p">,</span><span class="w"> </span><span class="n">GEN</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="s2">"Rheinland-Pfalz"</span><span class="p">)</span><span class="o">$</span><span class="n">percent</span><span class="p">,</span><span class="w"> </span><span class="n">digits</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">0</span><span class="p">)</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="m">0.5</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="m">2</span><span class="w">

</span><span class="n">df</span><span class="w"> </span><span class="o"><-</span><span class="w"> </span><span class="n">data.frame</span><span class="p">(</span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">val</span><span class="p">,</span><span class="w">
                 </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="m">7.5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">val</span><span class="p">)</span><span class="w">

</span><span class="n">qplot</span><span class="p">(</span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="m">0</span><span class="o">:</span><span class="m">15</span><span class="p">,</span><span class="w"> </span><span class="n">geom</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"blank"</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">annotation_custom</span><span class="p">(</span><span class="n">g</span><span class="p">,</span><span class="w"> </span><span class="n">xmin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmin</span><span class="p">,</span><span class="w"> </span><span class="n">xmax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">xmax</span><span class="p">,</span><span class="w"> </span><span class="n">ymin</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymin</span><span class="p">,</span><span class="w"> </span><span class="n">ymax</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">df</span><span class="o">$</span><span class="n">ymax</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w">
  </span><span class="n">map_theme</span><span class="w">
</span><span class="n">ggsave</span><span class="p">(</span><span class="s2">"my_image_Rheinland-Pfalz.png"</span><span class="p">,</span><span class="w"> </span><span class="n">bg</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"transparent"</span><span class="p&q...

To leave a comment for the author, please follow the link and comment on their blog: Shirin's playgRound.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)