title: How to plot locations on map in R?
body: <pre><code>library(ggmap) # -- for geocoding, obtaining city locations
  readRDS(&quot;gadm36_IND_2_sp.rds&quot;)
  ind2 = gadm
  </code></pre>
  <p>The output at the end is as below:</p>
  <p>Slot &quot;bbox&quot;:
  min      max
  x 68.186249 97.41516
  y  6.754256 35.50133</p>
  <p>Slot &quot;proj4string&quot;:
  CRS arguments:
  +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
  Error in eval(expr, envir, enclos): object 'gadm' not found
  Traceback:</p>
  <p>After that the next code is :</p>
  <pre><code># plotting districts of a State, in this case West Bengal
  wb2 = (ind2[ind2$NAME_1==&quot;West Bengal&quot;,])
  
  nam = c(&quot;Purulia&quot;,&quot;Bankura&quot;,&quot;Midnapur&quot;)
  pos = geocode(nam)
  tlat = pos$lat+0.05    # -- the city name will be above the marker
  cities = data.frame(nam, pos$lon,pos$lat,tlat)
  names(cities)[2] = &quot;lon&quot;
  names(cities)[3] = &quot;lat&quot;
  
  
  text1 = list(&quot;panel.text&quot;, cities$lon, cities$tlat, cities$nam,col=&quot;red&quot;, cex = 0.75)
  mark1 = list(&quot;panel.points&quot;, cities$lon, cities$lat, col=&quot;blue&quot;)
  text2 = list(&quot;panel.text&quot;,87.0,26.0,&quot;GADM map&quot;, col = &quot;dark green&quot;, cex = 1.2)
  spplot(wb2, &quot;NAME_1&quot;,
  sp.layout=list(text1,mark1, text2),
  main=&quot;West Bengal Districts&quot;,
  colorkey=FALSE, scales=list(draw=TRUE))
  </code></pre>
  <p>The output for the above code is:
  Error in eval(expr, envir, enclos): object 'ind2' not found
  Traceback:</p>
  <p>How to plot locations in map?</p>