title: Plotting Shapefile R - Incorrectly plots
body: <p>I am trying to produce a map (picture attached) but wish to overlay my shapefile onto the map. I cannot get it to work at present - the code for the shapefile is at the very end and I have included the summary of the shapefile in case this is useful - I am unsure whether it is the format of the coordinate system or something simpler? I've also attached a link to the datafiles to make this reproducible (<a href="https://onedrive.live.com/redir?resid=9E74848E574367C6!2648&amp;authkey=!AGApYipxXqSwZw4&amp;ithint=folder%2ccsv" rel="nofollow noreferrer">https://onedrive.live.com/redir?resid=9E74848E574367C6!2648&amp;authkey=!AGApYipxXqSwZw4&amp;ithint=folder%2ccsv</a>)</p>
  
  <pre><code> lon.data &lt;- c(28.5, 29.5, 30.5, 31.5, 32.5, 33.5, 34.5, 35.5, 36.5)       # Define the longitudinal data for matrix creation
   lat.data &lt;- c(-4.5, -3.5, -2.5, -1.5, -0.5,  0.5,  1.5,  2.5,  3.5,  4.5) # Define the latitudinal data for matrix creation
   nlons &lt;- length(lon.data)
   nlats &lt;- length(lat.data)
  
   x.limit &lt;- range(lon.data, na.rm=T)
   y.limit &lt;- range(lat.data, na.rm=T)
  
   Avg.Matrix.1 &lt;- matrix(NB.GRACE[,123], nrow=nlons, ncol=nlats, byrow=F) # Form a matrix for 2003-2012 gridded averages
  
   Avg.Matrix.1[Avg.Matrix.1 &gt; 30] &lt;- 30   # Reports all TWS anomalies &gt; 30 and 30cm
   Avg.Matrix.1[Avg.Matrix.1 &lt; -30] &lt;- -30 # Reports all TWS anomalies &lt; -30 and -30cm
   tws.range &lt;- c(-5,5)
  
   par(mar=c(7.8,6.3,0.4,6.3), mgp=c(1.5,0.5,0))
  
   image(lon.data, lat.data, Avg.Matrix.1, xlim=x.limit, ylim=y.limit, zlim=tws.range, asp=1, axes=F, 
    cex.axis=0.85, col=rev(tim.colors(60)), xlab="Longitude", ylab="Latitude", cex.lab=0.8)
   axis(1, at=seq(29, 36, by=1), labels=c("29°","30°","31°","32°","33°","34°","35°","36°"), cex.axis=0.8)
   axis(2, at=seq(-4, 4, by=1), labels=c("-4°","-3°","-2°","-1°","0°","1°","2°","3°","4°"), cex.axis=0.8, las=1)
  
   image.plot(zlim=tws.range, col=rev(tim.colors(50)), axis.args=c(cex.axis=0.9), legend.only=T)  
   grid(lwd=0.75, col="gray60", lty=1)
   abline(h=c(-4,-3,-2,-1,0,1,2,3,4), v=c(29,30,31,32,33,34,35,36), col="gray60", lty=3, lwd=0.5)
   box(lwd=1.5)
   LVB.Waterbodies &lt;- readShapeLines("Victoria Water Areas.shp")
   map(LVB.Waterbodies, add=TRUE, col=1)
  
  
   LVB.Waterbodies
   class       : SpatialLinesDataFrame 
   features    : 1 
   extent      : 133171.2, 761398.7, -418201.5, 55283.06  (xmin, xmax, ymin, ymax)
   coord. ref. : NA 
   variables   : 3
   names       : Id, Area,          iub 
   min values  :  0,    0, 69946.845771 
   max values  :  0,    0, 69946.845771
  </code></pre>
  
  <p>EDIT** This is the error message I get when I do:      </p>
  
  <pre><code>map(LVB.Waterbodies, add=TRUE, col=1)
  
  Error in `[.data.frame`(x@data, i, j, ..., drop = FALSE) : 
    undefined columns selected
  </code></pre>
  
  <p>The shapefile (additional picture) does not appear. I can make it appear using <code>plot(LVB.Waterbodies, col=1)</code> but this does not add it to the original plot, rather as a separate plot...as you suggest, this could be alignment? </p>
  
  <p><img src="https://i.stack.imgur.com/fQuvW.jpg" alt="Original Plot">
  <img src="https://i.stack.imgur.com/oDEbo.jpg" alt="Shapefile to add"></p>