title: Layer won't rasterize using raster package in r
body: <p>I'm having trouble rasterizing a shapefile using the raster package in R.</p>
  
  <pre><code>shp&lt;-shapefile(ZoneShape);
  lcRas&lt;-raster(lcRaster);
  
  r&lt;-raster(ncol=ncol(lcRas), nrow=nrow(lcRas), crs=CRS);
  res(r)&lt;-res(lcRas);
  extent(r)&lt;-extent(lcRas);
  
  &gt;r
  
  class       : RasterLayer 
  dimensions  : 22610, 27959, 632152990  (nrow, ncol, ncell)
  resolution  : 1, 1  (x, y)
  extent      : 554739, 582698, 3837197, 3859807  (xmin, xmax, ymin, ymax)
  coord. ref. : +proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +no_defs +towgs84=0,0,0
  
  shp$GID&lt;-1:nrow(shp);
  
  &gt; shp
  
  class       : SpatialPolygonsDataFrame 
  nfeatures   : 1 
  extent      : 554838, 582597.6, 3837297, 3859707  (xmin, xmax, ymin, ymax)
  coord. ref. : +proj=utm +zone=15 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0 
  nvariables  : 14
  names       : SP_ID,              NAME, Shape_Leng, Shape_Area, GID
  
  &gt;zoneRas&lt;-rasterize(shp, r, "GID")
  </code></pre>
  
  <p>The following error is returned:</p>
  
  <pre><code>trying to get slot "coords" from an object of a basic class ("NULL") with no slots.
  </code></pre>
  
  <p>Can anyone see what I'm missing/screwing up here?</p>
  
  <p>Thanks</p>