title: R from SpatialPointsDataFrame to SpatialLines
body: <p>I'have a SpatialPointsDataFrame load with </p>
  
  <pre><code>pst&lt;-readOGR("/data_spatial/coast/","points_coast")
  </code></pre>
  
  <p>And I would like to get a SpatialLines in output, I have find somthing </p>
  
  <pre><code>coord&lt;-as.data.frame(coordinates(pst))
  Slo1&lt;-Line(coord)
  
  Sli1&lt;-Lines(list(Slo1),ID="coastLine")
  coastline &lt;- SpatialLines(list(Sli1))
  class(coastline)
  </code></pre>
  
  <p>it seems to work but when I try plot(coastline) , I have a line that should not be there ...
  <img src="https://i.stack.imgur.com/J35Qv.png" alt="a bad coastline"></p>
  
  <p>Some one can help me ? <a href="http://dl.free.fr/geDukHanh" rel="noreferrer">The shapefile is here</a> !</p>