title: Counting the number of lines that pass through a given polygon using R
body: <p>How can I count the number of lines passing through a polygon given the following.</p>
  
  <ol>
  <li>I am accessing the polygon from a SpatialPolygonDataFrame (e.g. SpatialPolygon@polygons[[<a href="http://i.stack.imgur.com/Bpu13.png" rel="nofollow">1</a>]])</li>
  <li>the lines are SpatialLines</li>
  </ol>
  
  <p><a href="http://i.stack.imgur.com/Bpu13.png" rel="nofollow">Here is a sample picture</a></p>