title: Adding standard deviation to barplot() in R
body: <p>In R I have the following dataframe: </p>
  
  <pre><code>  Group mean  sd
  1     1   21.2  5.202563
  2     2   28.4  6.113737
  3     3   21.8  2.529822
  </code></pre>
  
  <p>I would like to create a barplot with the means and the standard deviations as arrows on top of the means like this example:
  <a href="https://i.stack.imgur.com/3HS9q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3HS9q.png" alt="enter image description here"></a></p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>barCenters &lt;- barplot(height = Ymeans12stdev$mean,main = "Average Time per Group",
                    xlab = "Group", ylab = "Time")
  </code></pre>
  
  <p>However, I am not succeeding in adding the standard deviation bars. Can anyone solve this ? :) </p>