title: How to split SpatialLines in R?
body: <p>How to split a SpatialLine that consists of two not connected segments?</p>
  
  <p>Following code creates an example:</p>
  
  <pre><code>l1 = cbind(c(1,2),c(3,2))
  rownames(l1) = letters[1:2]
  l2 = cbind(c(3,4),c(1,4))
  rownames(l1) = letters[3:4]
  Sl1 = Line(l1)
  Sl2 = Line(l2)
  Ll1 = Lines(list(Sl1), ID="a")
  Ll2 = Lines(list(Sl2), ID="b")
  Sl = SpatialLines(list(Ll1,Ll2))
  m&lt;-gLineMerge(Sl)
  </code></pre>
  
  <p>Actually the reverse function of <code>gLineMerge()</code> should do the job. </p>