title: Labeling center of map polygons in R ggplot
body: <p>I am trying to label my polygons by using ggplot in R. I found a topic here on stackoverflow that I think is very close to what I want except with points. </p>
  
  <p><a href="https://stackoverflow.com/questions/15624656/labeling-points-in-geom-point-graph-in-ggplot2">Label points in geom_point</a> </p>
  
  <p>I found some methods online. Now I first need to find the central location of each shape and then I have to put these locations together with the name together. Then link this to the labeling function in geom_text()</p>
  
  <p><a href="https://stackoverflow.com/questions/9441436/ggplot-centered-names-on-a-map">ggplot centered names on a map</a></p>
  
  <p>Since I have been trying for a long time now I decided to ask the question and hope that someone here can give me the final push to what I want. My plotting function: </p>
  
  <pre><code>region_of_interest.fort &lt;- fortify(region_of_interest, region = "score")
  region_of_interest.fort$id &lt;- as.numeric(region_of_interest.fort$id)
  region_of_interest.fort$id &lt;- region_of_interest.fort$id
  
  
  region_of_interest.fort1 &lt;- fortify(region_of_interest, region = "GM_NAAM")
  region_of_interest.fort1$id &lt;- as.character(region_of_interest.fort1$id)
  region_of_interest.fort1$id &lt;- region_of_interest.fort1$id
  
  idList &lt;- unique(region_of_interest.fort1$id)
  centroids.df &lt;- as.data.frame(coordinates(region_of_interest))
  names(centroids.df) &lt;- c("Longitude", "Latitude")
  randomMap.df &lt;- data.frame(id = idList, shading = runif(length(idList)), centroids.df)
  
  ggplot(data = region_of_interest.fort, aes(x = long, y = lat, fill = id, group = group)) +
    geom_polygon() +
    geom_text(centroids.df, aes(label = id, x = Longitude, y = Latitude)) +
    scale_fill_gradient(high = "green", low = "red", guide = "colorbar") +
    coord_equal() +
    theme() +
    ggtitle("Title")
  </code></pre>
  
  <p>It gives me the error: ggplot2 doesn't know how to deal with data of class uneval</p>
  
  <p>My data</p>
  
  <pre><code>region_of_interest$GM_NAAM
   [1] Groningen        Haren            Ooststellingwerf Assen            Aa en Hunze      Borger-    Odoorn   
   [7] Noordenveld      Westerveld       Tynaarlo         Midden-Drenthe  
  415 Levels: 's-Gravenhage 's-Hertogenbosch Aa en Hunze Aalburg Aalsmeer Aalten ... Zwolle
  
  region_of_interest$score
   [1] 10 -2 -1  2 -1 -4 -4 -5  0  0
  </code></pre>