title: Exporting a subset of a SpatialPointsDataFrame
body: <p>I have created a <code>SpatialPointsDataFrame</code> using the following code:  </p>
  
  <pre><code>SpatialPointsDataFrame(coords = xy, data = data4xy,
                         proj4string = CRS("+proj=utm +zone=9 ellps=WGS84"))  
  </code></pre>
  
  <p>where <code>data4xy</code> is a data frame containing 2 columns, <code>date</code> is the time stamp associated with each GPS point and <code>id</code> is the id of the tracked animal.</p>
  
  <p>From this <code>SpatialPointsDataFrame</code>, I would like to export a shapefile using <code>writeOGR()</code> for each tracked animal (essentially grouping by <code>id</code>).  How would I go about implementing this?</p>