title: Plot a line graph with standard deviation in R
body: <p>I have a dataframe similar to this one:</p>
  
  <pre><code>myTable &lt;- "ID Data Group
          1     -50     5.0
          2     -44     5.0
          3     -48     5.0
          4     -50     4.9
          5     -44     4.9
          6     -48     4.9
          7     -48     4.9
          8     -44     4.8
          9     -49     4.8
         10     -48     4.8
         11     -60     4.8
         10     -50     4.8
         11     -80     4.7"
  Data &lt;- read.table(text=myTable, header = TRUE)
  </code></pre>
  
  <p>The data is sorted by ID and Group. The groups do not all have the same size but have at least one member. The data is always negative.
  What I plan to do, is to make a line graph with the "Group" as x-axis and "Data" as y-axis and it should also show the standard deviation of each group.</p>
  
  <p>I am a R beginner. So my knowledge is very limited, I only have a bit experience with the ggplot2 library. I tried to use the function geom_errorbar but without success.
  What I tried looked something like this:</p>
  
  <pre><code>require("ggplot2")
  pplot &lt;- ggplot(data=data, aes(x=group, y=data))
  pplot + geom_errorbar(aes(ymax = &lt;Max of each group&gt;, ymin= &lt;Min of each group&gt; ), width= 0.1)
  pplot + geom_line();
  </code></pre>
  
  <p>So the result should have a form like this graph:
  <a href="https://i.stack.imgur.com/TtB7b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TtB7b.png" alt="enter image description here"></a></p>