Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm doing a bit of guessing about what you want, exactly, as I'm not sure what you were attempting with <code>geom_segment</code>, whether that was part of your data, or an attempt to create an arrow. But you can build on <code>geom_segment</code> to get something like what you describe:</p> <pre><code>#Your test data, with a small typo repaired dd &lt;- data.frame(x = c("A","B","C","D","E","F","G","H","I"), y = c(1.782,0.136,0.978,0.645,0.518,1.474,0.855,0.673,0.369)) dd &lt;- transform(dd, ylo = c(0.719,0.046,0.945,0.295,0.188,0.577,0.407,0.310,0.145), yhi = c(4.420,0.398,1.012,1.411,1.424,3.768,1.798,1.460,0.940)) #Create a separate data frame for the arrow labels arrowLab &lt;- data.frame(lab = c("Increasing","Decreasing"), x = c(0.15,0.15),y = c(10^0.25,10^(-0.25))) ggplot(data = dd, aes(x=ordered(x, levels=rev(x)), y=y)) + geom_pointrange(aes(ymin=ylo, ymax=yhi)) + geom_segment(aes(x = 0, xend = 0, y= 1, yend= 2), arrow=arrow(length=unit(0.2,"cm"))) + geom_segment(aes(x = 0, xend = 0, y= 1, yend= 10^(-0.25)), arrow=arrow(length=unit(0.2,"cm"))) + geom_text(data = arrowLab,aes(x=x,y=y,label = lab),size = 3) + coord_flip() + geom_hline(aes(yintercept=1), lty=2) + scale_y_log10() </code></pre> <p><img src="https://i.stack.imgur.com/lLBTL.png" alt="enter image description here"></p> <p>Note that I hard-coded much of the positioning, so you'll likely want to tinker with those values to get what you want, or you could try to choose them programmatically based on your data.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload