0

New to R and I am examining difference between flower/seed ratio, under two treatments at three different locations. I am trying to add significance values to a faceted ggplot, and am missing a fundamental step in the logic.

I have tried the below, but can't seem to figure out what step I am missing. Maybe it is because I am plotting a model output which only has my predicted values and CI...

seed_open<-ggplot(predsopen2,
aes(x=treat, y=preds, colour = treat))+
geom_point(stat = "identity", width = 0.9) +
scale_colour_manual(values = c("open" = "#0072B2", "outcross" = "#D55E00"))+
facet_wrap(.~loc,ncol = 3)+
geom_errorbar(aes(ymin = CIlow, ymax = CIhi), width=0.1) +  ylim(0,2.3)+
theme(legend.position="none")+
labs(x="Treatment", y=expression("Seed/flower ratio"))
geom_signif(comparisons=list(c("open", "outcross"),
                          c("open", "outcross"),
                          c("open", "outcross")),
                           annotations = c("ns","***","*"))

But all I get is this..... GGPLOT Any tips on what I am missing?

DF here Dataframe

And I want to create something like this.What I am trying to create

As a bonus, it would be good to compare treatments between the sites too, but I can't even begin to think how to wrangle that! I have also tried to simply annotate geom_text () but haven't cracked that either. Any tips would be really appreciated. Thank you

  • 1
    Please [make this question reproducible](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) by including example data in a plain text format - for example the output from `dput(predsopen2)`. We cannot copy/paste data from images. You should also mention that you are using the `ggpubr` library. – neilfws Nov 24 '21 at 01:37

0 Answers0