This is a repeat of a question originally asked here: Indicating the statistically significant difference in bar graph but asked for R instead of python.
My question is very simple. I want to produce barplots in R, using ggplot2 if possible, with an indication of significant difference between the different bars, e.g. produce something like this. I have had a search around but can’t find another question asking exactly the same thing.

You can use
geom_path()andannotate()to get similar result. For this example you have to determine suitable position yourself. Ingeom_path()four numbers are provided to get those small ticks for connecting lines.