j'utilise cette ligne de code mais je n'arrive pas a ajouter des bars d'erreur correspondant au ecart type

posn.d<-position_dodge(width=0.95)
ggplot(data=maladie,mapping=aes(x=modalite,y=nbr_lesions_5,fill=modalite))+
stat_summary(fun.data = mean_sdl,geom = "bar",position=posn.d)+
labs(x="Modalités",y="nombre de lésions par plante" )+
theme(axis.text.x = element_text(color = "black", size = 10, angle = 45, hjust = .5, vjust = .5),
axis.text.y = element_text(color = "black", size = 10, angle = 0, hjust = 1, vjust = 0))+
theme(
plot.title = element_text(color="black", size=24, face="bold",hjust=0.5),
axis.title.x = element_text(color = "black", size = 14, face = "bold"),
axis.title.y = element_text(color = "black", size = 12, face = "bold"),
strip.text = element_text(size = 10,face = "bold"),
legend.title=element_text(size=10, face = "bold"),
legend.text=element_text(size=10, face = "bold"))+
theme_classic()

Hi, welcome to the forum.

I think you are missing some code.

See geom_errorbar function - RDocumentation.

To really check things we need some sample data.
A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need. Just do dput(mydata) where mydata is your data. Copy the output and paste it here.
A general guide to asking quentions is available here
FAQ

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.