title: R map: how do I fill the regions?
body: <p>I'm plotting a map here and can't fill it right, I hope you can help. So what do I do</p>
  
  <p>Read the map and change projection:</p>
  
  <pre><code>map&lt;-readOGR(dsn="e:\\r\\OSM_adm_reg\\adm4_region (1)", layer="adm4_region")
  map=spTransform(map,CRS("+proj=latlong +ellips=GRS80"))
  </code></pre>
  
  <p>Read data about location of logistics warehouses throughout the country and match the world.cities database to plot them on the map:</p>
  
  <pre><code>    data(world.cities)
      russian.cities=world.cities[world.cities$country.etc=="Russia",]
      metro_outlets=read.csv(file="e:\\r\\retail\\metro.csv",head=TRUE,sep=";")
      match&lt;-match(metro_outlets$CITY_ENGLISH, russian.cities$name)
      outlet_coordinates=russian.cities[match,]
      outlet_coordinates=cbind(outlet_coordinates, "metro_store_count"=metro_outlets$STORE_COUNT_METRO)
      outlet_coordinates=cbind(outlet_coordinates, "cch_depo"=metro_outlets$DEPO_FOOD)
      outlet_coordinates=cbind(outlet_coordinates, "NAME_LAT"=metro_outlets$STORE_OBLAST)
      outlet_coordinates=cbind(outlet_coordinates, "cch_franchise"=metro_outlets$Franchise)
  outlet_coordinates=cbind(outlet_coordinates, "SL"=metro_outlets$SL)
  </code></pre>
  
  <p>Basically, I'm gonna need to fill regions based on the values of the SL column.
  Now, Im trying to get a list of regions that contains the WHs:</p>
  
  <pre><code>outlet_spatial=SpatialPoints(outlet_coordinates[,c(5,4)],proj4string=CRS(proj4string(map)))
  index=over(outlet_spatial,map)
  region_names=rownames(map@data[map@data$NAME_LAT %in% index$NAME_LAT,])
  map_df&lt;-fortify(map,map$NAME_LAT)
  map_df$fill=ifelse(map_df$id %in% region_names,"true","false")
  </code></pre>
  
  <p>And plot the map:</p>
  
  <pre><code>ggplot()+
    geom_polygon(data=map_df,aes(x=long,y=lat,group=group,fill=fill),col="gray")+
    scale_fill_manual(values=c("gray","gray70"))+xlim(20, 180) + ylim(40,80)+
    geom_point(aes(x=long,y=lat), color="orange",alpha=I(8/10), data=outlet_coordinates)
  </code></pre>
  
  <p>This is the map I <a href="http://picpaste.com/LW9UJkt0.jpeg" rel="nofollow">got</a>!</p>
  
  <p>Now, I don't know how to pass the values of the SL column to the <code>map_df</code> and fill regions accordingly. SL defined here:   <code>outlet_coordinates=cbind(outlet_coordinates,"SL"=metro_outlets$SL)</code></p>