0

I am trying to add error bars, but they will not "dodge" based on my fill-parameter. Did I do something wrong?

 > head(dual)
  siRNA    value CellLine        std Time
1 X1    1.686577       KO 0.18671567   3h
2 X2    1.363829       KO 0.12593857   3h
3 X3    1.264940       KO 0.02890541   3h
4 X4    1.368086       KO 0.11471607   3h
5 X5    1.324891       KO 0.02526011   3h
6 X6    1.274572       KO 0.17476550   3h

p <- ggplot(dual, aes(siRNA, value)) + 
  geom_bar(aes(fill=CellLine), stat="identity",position = "dodge") + 
  theme_bw() + 
  theme(axis.text.x = element_text(angle = 90, hjust = 1)) +
  facet_grid(~Time, scales="free") + theme_bw() 

p +  geom_errorbar(aes(ymin=value-std, ymax=value+std), width=.1) +
     facet_grid(~Time)
Richard Telford
  • 9,558
  • 6
  • 38
  • 51
user2300940
  • 2,355
  • 1
  • 22
  • 35
  • 1
    Does this help: http://stackoverflow.com/questions/13050516/how-to-make-dodge-in-geom-bar-agree-with-dodge-in-geom-errorbar-geom-point – Richard Telford Jun 27 '16 at 07:37
  • 1
    This isn't really reproducible because the data you provide only has one value for `CellLine` and `Time`, making the dodging and faceting pointless. – alistaire Jun 27 '16 at 08:26

0 Answers0