title: R - SpatialPointsDataFrame from a list of SpatialPoints
body: <p>How to create a SpatialPointsDataFrame from a list of SpatialPoints?</p>
  
  <p>In the following there´s a code of a list containing SpatialPoints:. </p>
  
  <pre><code>SP1 &lt;- SpatialPoints(cbind(1,5))
  SP2 &lt;- SpatialPoints(cbind(2,4))
  SP3 &lt;- SpatialPoints(cbind(3,3))
  
  SP.l&lt;-list(SP1,SP2, SP3)
  </code></pre>
  
  <p>What I´m looking for is a way to extract the SpatialPoints from the list and create a SpatialPointsDataFrame out of it.</p>
  
  <p>With the following code I can get single SpatialPoints out of the list:</p>
  
  <pre><code>coords_3 = SP.l[[3]]@coords
  data_3 = as.data.frame(SP.l[[3]])
  
  SPDF_3 &lt;- SpatialPointsDataFrame(coords=coords_3, data=as.data.frame(data_3))
  </code></pre>
  
  <p>However I´d like receive all at once. 
  Maybe something like:</p>
  
  <pre><code>SP &lt;- SpatialPoints(lapply(1:length(lidR.clip.SP.l), function(i) {
  </code></pre>
  
  <p>... </p>
  
  <p><strong>EDIT:</strong>
  what was missing was:</p>
  
  <pre><code>SP.l &lt;- do.call("rbind", SP.l)
  </code></pre>
  
  <p>That´s what I was actually looking for.</p>
  
  <p>thx!</p>