title: How to fill a map from a shapefile using its own attributes table in R?
body: <p>I see some people using R to fill maps from shapefiles, e.g. <a href="https://stackoverflow.com/a/19339663/7769755">here</a>. With my R knowledge, I only read the shapefile and plot it.</p>
  
  <p>With QGIS I added an extra column to the attribute table called "OCCURENCE". This column is a year when a specific event occurred. I'd like to fill each country according to the year of occurence using a color scale, leaving the countries with no data without fill. The folder with the shapefiles is <a href="https://drive.google.com/drive/folders/19_zXZJV0Pz8lc3CkixTswyp3GXz_ISxR?usp=sharing" rel="nofollow noreferrer">here</a>. As example, I added some years to a few countries, and I like to obtain something like:</p>
  
  <p><a href="https://i.stack.imgur.com/LDJWv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LDJWv.png" alt="enter image description here"></a> and a legend <a href="https://i.stack.imgur.com/0aO85.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0aO85.png" alt="enter image description here"></a>.</p>
  
  <pre><code>library(rgdal)
  library(ggplot2)
  
  World &lt;- readOGR(dsn = "mundo", layer = "mundo")
  class(World)
  
  World2 &lt;- fortify(World)
  class(World2)
  
  ggplot() + 
    geom_polygon(data = World2, aes(x = long, y = lat, group = group),
                 colour = "black", size = 0.5, fill = "white")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/b4OLl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b4OLl.png" alt="enter image description here"></a></p>
  
  <p>Any help??</p>