title: Apply a function over many shapefiles
body: <p>I want to apply a function, either one that I have written, or one from a package such as the <code>gArea</code> function (e.g. <code>gArea('shapefile')</code>) from the <code>rgeos</code> package, across a list of shapefiles that I have imported. </p>
  
  <p>I imported the files like this:</p>
  
  <pre><code>data &lt;- list.files (getwd() , pattern="shp") 
  </code></pre>
  
  <p>I have tried using methods using functions such as <code>lapply</code> etc once I have tried amalgamating the files by using <code>as.list</code>, <code>as.data.frame</code> etc but with no luck. Functions applied to single imported shapefiles work fine, but obviously no good for serioues throughput.</p>
  
  <p>Thoughts? </p>