I am trying to plot the means as points and use arrows as error bars. I have successfully made the violin plot however, when I try to add additional points and arrows error messages keep coming up. For example unexpected "," and need to define limits. My x axis is characters rather than numbers if that makes a difference.
Here is my script;
NO ERROR MESSAGES:
ggplot(five,aes(x=Derivative,y=Score))+geom_violin()+scale_x_discrete(limits=c("None","134","138"))+geom_dotplot(binaxis="y",stackdir="center",dotsize=0.75)+ylim(0,4)+ylab("Score")+xlab("TLR4 Antagonist")
ERROR MESSAGES:
x<-"None" (THIS IS A LABEL ON THE X AXIS)
y<-1.7
...("TLR4 Antagonist") + plot(x,y, col="black) + arrows(x0=x, y0=y-0.3, x1=x, y1=y+0.3, code=3, angle=90, length=0.2, col="black", lwd=2)
(five)
|Score|Derivative|
|2|None|
|2|None|
|3|None|
|1|None|
|3|134|
|2|134|
|2|134|
|1|134|
|0|138|
|1|138|
|2|138|
|1|138|
Do you see any problems?
Thanks for your help.