title: Choropleth map in ggplot with polygons that have holes
body: <p>I'm trying to draw a choropleth map of Germany showing poverty rate by state (inspired by <a href="https://stackoverflow.com/questions/21651985/shapefile-to-produce-a-linked-micromap-in-r/21747782#21747782">this question</a>). </p>
  
  <p>The problem is that some of the states (Berlin, for example) are completely surrounded by other states (Brandenburg), and I'm having trouble getting ggplot to recognize the "hole" in Brandenburg.</p>
  
  <p>The data for this example is <a href="https://www.dropbox.com/s/c43k755aadvu2z6/germany.rar" rel="nofollow noreferrer">here</a>.</p>
  
  <pre><code>library(rgdal)
  library(ggplot2)
  library(RColorBrewer)
  
  map &lt;- readOGR(dsn=".", layer="germany3")
  pov &lt;- read.csv("gerpoverty.csv")
  
  mrg.df &lt;- data.frame(id=rownames(map@data),ID_1=map@data$ID_1)
  mrg.df &lt;- merge(mrg.df,pov, by="ID_1")
  map.df &lt;- fortify(map)
  map.df &lt;- merge(map.df,mrg.df[,c("id","poverty")], by="id")
  ggplot(map.df, aes(x=long, y=lat, group=group)) +
    geom_polygon(aes(fill=poverty))+
    geom_path(colour="grey50")+
    scale_fill_gradientn(colours=brewer.pal(5,"OrRd"))+
    labs(x="",y="")+ theme_bw()+
    coord_fixed()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/fnaZP.png" alt=""></p>
  
  <p>Notice how the colors for Berlin and Brandenburg (in the northeast) are identical. They shouldn't be - Berlin's poverty rate is much lower than Brandenburg. It appears that ggplot is rendering the Berlin polygon and then rendering the Brandenburg polygon over it, without the hole.</p>
  
  <p>If I change the call to <code>geom_polygon(...)</code> as suggested <a href="https://stackoverflow.com/questions/12033560/use-ggplot-to-plot-polygon-with-holes-in-a-city-map">here</a>, I can fix the Berlin/Brandenburg problem, but now the three northernmost states are rendered incorrectly.</p>
  
  <pre><code>ggplot(map.df, aes(x=long, y=lat, group=group)) +
    geom_polygon(aes(group=poverty, fill=poverty))+
    geom_path(colour="grey50")+
    scale_fill_gradientn(colours=brewer.pal(5,"OrRd"))+
    labs(x="",y="")+ theme_bw()+
    coord_fixed()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/4flfm.png" alt=""></p>
  
  <p>What am I doing wrong??</p>