title: How can I cut curves drawn by `geom_curve` in order they don't overlap labels plotted by `geom_text` in `ggplot2`?
body: <p>I have a <code>df</code> containing elements of type <code>var</code> and <code>link</code>. I want to plot the elements <code>var</code> as text label using <code>geom_text</code> and the <code>links</code> as arrows using <code>geom_curve</code>. The problem is, that the <code>links</code> overplot the labels whereas I want them to start and stop just beside the labels.</p>
  
  <hr>
  
  <p>What I have:</p>
  
  <pre><code>  type   x    y                    label from_x from_y to_x to_y
  1 link  NA   NA                     &lt;NA&gt;    608   -229  460 -276
  2 link  NA   NA                     &lt;NA&gt;    428   -274  570 -226
  3  var 610 -226 accomplishments per week    608   -229  460   NA
  4  var 426 -276    hours worked per week    428   -274  570   NA
  </code></pre>
  
  <p>When I plot it it looks as follows:</p>
  
  <pre><code>ggplot(df) + geom_text(aes(x, y, label = label)) + geom_curve(aes(x = 
  from_x,y = from_y,xend = to_x, yend = to_y), curvature = -.3, arrow = arrow(length = unit(0.03, "npc")), color = "red")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8hqEx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8hqEx.png" alt="enter image description here"></a></p>
  
  <hr>
  
  <p>What I expect is: </p>
  
  <p><a href="https://i.stack.imgur.com/RMvuY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RMvuY.png" alt="enter image description here"></a></p>
  
  <p><strong>How can I achieve this?</strong></p>
  
  <hr>
  
  <p>Here is my <code>df</code>:</p>
  
  <pre><code>df &lt;- structure(list(type = structure(c(1L, 1L, 2L, 2L), .Label = c("link", 
  "var"), class = "factor"), x = c(NA, NA, 610, 426), y = c(NA, 
  NA, -226, -276), label = c(NA, NA, "accomplishments per week", 
  "hours worked per week"), from_x = c(610, 426, NA, NA), from_y = c(-226, 
  -276, NA, NA), to_x = c(426, 610, NA, NA), to_y = c(-276, -226, 
  NA, NA)), .Names = c("type", "x", "y", "label", "from_x", "from_y", 
  "to_x", "to_y"), row.names = c(NA, -4L), class = "data.frame")
  </code></pre>
  
  <p>And here is the <em>manual</em> tweak I did to plot my expected output:</p>
  
  <pre><code>df$from_x &lt;- c(608, 428)
  df$from_y &lt;- c(-229, -274)
  df$to_x &lt;- c(460, 570)
  
  ggplot(df) + geom_text(aes(x, y, label = label)) + geom_curve(aes(x = from_x,y = from_y,xend = to_x, yend = to_y), curvature = -.3, arrow = arrow(length = unit(0.03, "npc")), color = "red")
  </code></pre>