title: R, leaflet, fill polygons with colours
body: <p>I have shape data for London, and want to colour different regions red, yellow, and green.</p>
  
  <p>My code works, but does not fill it according to red, yellow, or green.</p>
  
  <p>The data is: <a href="https://data.london.gov.uk/dataset/statistical-gis-boundary-files-london" rel="nofollow noreferrer">https://data.london.gov.uk/dataset/statistical-gis-boundary-files-london</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>library("rgdal")
  library(leaflet)
  shapeData &lt;- readOGR('statistical-gis-boundaries-london/ESRI/LSOA_2004_London_Low_Resolution.shp')
  shapeData &lt;- spTransform(shapeData, CRS("+proj=longlat +ellps=GRS80"))
  LANAME='Camden'
  shapeData$col=sample(c('red','yellow','green'),nrow(shapeData),1)
  leaflet()  %&gt;% addTiles() %&gt;% 
    setView(lng = -0.106, lat=51.5177,zoom=14) %&gt;% 
    addPolygons(data=bor,weight=2,col = 'black',fillOpacity = 0.02,fillColor = shapeData$col,
                highlightOptions = highlightOptions(color='white',weight=1,
                                                    bringToFront = TRUE)) %&gt;% 
    addMarkers(lng = -0.106,lat=51.5177,popup="Hi there")
  </code></pre>
  
  <p>The output is:</p>
  
  <p><a href="https://i.stack.imgur.com/Gvh7L.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gvh7L.png" alt="enter image description here"></a></p>
  
  <p>Can anyone point out why I do not see yellow, green, or red only, and see all these other colours as well.</p>
  
  <p>Thanks</p>