title: sp::over() for point in polygon analysis
body: <p>I have a shapefile named "ind_adm" and a SpatialPointsDataFrame called "pnts". The "pnts" contains points generated at random, and some of the points overlap with the polygon. See picture below.
  <img src="https://i.stack.imgur.com/Hxwif.jpg" alt="enter image description here"></p>
  
  <p>Now, I want do do a point in polygon analysis, i.e. I want to find out which points lie inside the gray polygon representing the boundary of India. For this I am using the over() function in the sp library. </p>
  
  <pre><code>pt.in.poly &lt;- sp::over(ind_adm, pnts, fn = mean) #do the join
  </code></pre>
  
  <p>However, the output I am getting is </p>
  
  <pre><code>    &gt;pt.in.poly
      values
      0 6.019467
  </code></pre>
  
  <p>I should actually get the index of the points that are "in" the polygon.</p>
  
  <p>Where am I going wrong?</p>