title: Drawing arrows with two different colors depending on the direction in ggplot
body: <p>I would like to change the color of arrows depending on the direction. I figured out to insert the arrows in the plot, but at the moment they are all black. I would like to have arrows from left to right in green and arrows from right to left in red. Is that possible?</p>
  
  <p>Here is my "short" code: </p>
  
  <pre><code>library(ggplot2)
  
  name = c("Name1","Name2", "Name1", "Name2")
  time = c("1", "3","4","2")
  value = c(5.1, 4.8, 4.1, 6.3)
  data &lt;- data.frame(name, time, value) 
  
  p &lt;- ggplot(data, aes(x=value, y=name)) +
    geom_point(aes(colour=time), shape=16, size=6) +
    geom_path(aes(group=name), arrow=arrow(length=unit(0.15,"cm")), colour="black", size=1) 
  print(p)
  </code></pre>
  
  <p>Thank you in advance for any help you can provide!</p>