title: Create convex hull polygon from points and save as shapefile
body: <p>Needing some help re a conversion problem in R.</p>
  
  <p>I've got calculated the <a href="http://en.wikipedia.org/wiki/Convex_hull">convex hull</a> of a cloud of points. I'd like, from the points forming the convex hull, to build a <em>polygon object</em> and save that as a <em>shapefile</em> that can be read by a GIS software (ArcMap or the like).</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>gps &lt;- read.csv(f)  ##reads the lat-long coordinates  file 
  x &lt;- gps$LONGITUDE  ##tells R which columns is which
  y &lt;- gps$LATITUDE
  z&lt;-chull(x,y)       ##calculates the convex hull --this is just a list of x-y points, N vertex 
  dfHull &lt;-cbind(x[z],y[z])  ##the convex hull expressed as a list of selected x-y points
  plot(dfHull)     ##this plots the vertex of the polygon, just a check
  lines(dfhull)    ##plots the polygon in screen
  
  ##generate polygon shapefile, from dfHull, and save it externally as a shapefile ???
  </code></pre>
  
  <p>The source file only contains lat-long coordinates, e.g:</p>
  
  <pre><code>52.73336     N  0.365974
  52.7332  N  0.366051
  52.73289     N  0.36636
  52.73297     N  0.366258
  52.73298     N  0.366243
  52.733   N  0.366112
  52.73308     N  0.365942
  52.73317     N  0.365881
  52.73321     N  0.36593
  52.73328     N  0.365942
  52.73352     N  0.36579
  52.73362     N  0.365678
  52.73391     N  0.365536
  52.7373  N  0.36543
  52.73289     N  0.36728
  </code></pre>
  
  <p>I know there are packages (rgdal,maptools,..) to help with these, but I'm very unfamiliar with spatial stuff. Really all I need is to generate the polygon object and save that as shapefile.</p>
  
  <p>Any help appreciated. Thanks in advance,              dev.</p>