title: Proportionally sized arrows in ggplot
body: <p>Building on ggplot2's <a href="http://docs.ggplot2.org/current/geom_segment.html" rel="nofollow noreferrer">seals example</a>, I'm trying to change the thickness of arrows so their overall size better reflects the data variable.  I can specify length and thickness, but don't know how to change the size of the arrow-head.  Very grateful for any suggestions.</p>
  
  <pre><code>require(ggplot2)
  require(grid)
  
  d = seals[sample(1:nrow(seals), 100),]
  d$size = sqrt(sqrt(d$delta_long^2 + d$delta_lat^2))
  
  ggplot(d, aes(x = long, y = lat, size = size)) +
    geom_segment(aes(xend = long + delta_long, yend = lat + delta_lat), arrow = arrow(length = unit(0.1,"cm")))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/d6Wir.png" alt="enter image description here"></p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>Solution code:</p>
  
  <pre><code>ggplot(d, aes(x = long, y = lat, size = size)) +
    geom_segment(aes(xend = long + delta_long, yend = lat + delta_lat), 
                 arrow = arrow(length = unit(d$size/3, "cm"), type='closed')) +
    scale_size(range = c(0, 2))
  </code></pre>