0

I'm new to R and need to draw an error bar. The raw data looks like this:

ID    Day    pH
1      1      7
1      1      7.2
1      1      7.1
2      1      7.3
2      1      7.4
2      1      7.2
3      1      7
3      1      7.1
3      1      7.5
4      1      7.3
4      1      7.2
4      1      7.6
1      2      7
1      2      7.2
1      2      7.1
2      2      7.1
2      2      7.4
2      2      7.2
3      2      7.5
3      2      7.1
3      2      7.5
4      2      7.2
4      2      7.2
4      2      7.3
1      3      7.4
1      3      7.2
1      3      7.1
2      3      7.2
2      3      7.4
2      3      7.2
3      3      7.4
3      3      7.2
3      3      7.5
4      3      7.4
4      3      7.2
4      3      7.7

I want to create a barplot with error bars showing the mean pH value on the y-axis and the ID on the x-axis with the days in different coloured bars and the standard deviation as error bars.

nograpes
  • 18,623
  • 1
  • 44
  • 67
Simza
  • 1
  • 2
  • Also take a look at [this](http://stackoverflow.com/questions/15535708/barplot-with-significant-differences-and-interactions/15553486#15553486) – nograpes Apr 10 '13 at 15:04
  • 1
    [**What have you tried already**](http://mattgemmell.com/2008/12/08/what-have-you-tried/)? Since you are new here you might want to read [**the about**](http://stackoverflow.com/about) and the [**faq**](http://stackoverflow.com/faq) about how SO works. – Simon O'Hanlon Apr 10 '13 at 15:04
  • I have already answered this question here: [enter link description here][1] [1]: http://stackoverflow.com/questions/15927193/calculate-mean-and-sd-by-id-and-day-within-a-column – droopy Apr 10 '13 at 15:07
  • @ droopy: Thanks a lot. I already tried thatand the style of the graph is as I wanted it, but all the bars and error-bars have the same length... I'm not really sure what I'm doing wrong!? – Simza Apr 10 '13 at 15:15

0 Answers0