0
votes

p<- ggplot(cherry, aes(x=Color, y=SSC, group=Row.size, color=Row.size)) +

geom_line() +

geom_point()+

geom_errorbar(aes(ymin=SSC-sd, ymax=SSC+sd), width=.2,

position=position_dodge(0.05))

p

Error in SSC - sd : non-numeric argument to binary operator

Hello, I am trying to make a ggplot graph but I am getting this error. I researched but unfortunately I could not find any information. Please help me. Thank you!!

1
From the error message I guess that sd is not a variable in your dataset. If you want sd to be the standard deviation of variable SSC try geom_errorbar(aes(ymin=SSC-sd(SSC), ymax=SSC+sd(SSC)), width=.2, position=position_dodge(0.05)).stefan
To be honest, it worked but all line looks so messy and it does not show to error barsugur Emre

1 Answers

0
votes

As stefan mentioned it is because you have not defined sd in your dataset and from your results as you describe them in your answer, I suspect that you haven't summerized your data. Here's a good description of the function summarySE that summerises the data for you so you can plot them.