Hope that helps to a comment above by @camille, I learned about

ggsignif, which is loaded by ggpubr. I added two ggsignif layers so I could set the line thickness (the size parameter) to zero for the two ungrouped sites.

```
library(dplyr)
library(ggplot2)
library(ggsignif)
reach <- c("Pool 4", "Pool 8", "Pool 16", "Pool 26", "LaGrange", "Open River")
n <- c(30, 6, 3, 29, 12, 76)
avg <- c(812, 819, 674, 649, 698, 679)
se <- c(24, 32, 43, 21, 31, 12)
dat <- data.frame(reach, n, avg, se)
dat <- dat %>%
mutate(reach = factor(reach, levels = reach, ordered = TRUE))
pos_nudge = 10
ggplot(dat,
aes(x = reach,
y = avg)) +
geom_point() +
geom_linerange(aes(x = reach,
ymin = avg - se,
ymax = avg + se)) +
geom_signif(y_position = max(avg + se + pos_nudge),
xmin = c(1, 3),
xmax = c(2, 4),
annotation = c("A", "B"),
tip_length = 0) +
geom_signif(y_position = max(avg + se + pos_nudge),
xmin = c(5, 6),
xmax = c(5, 6),
annotation = c("B", "B"),
tip_length = 0,
size = 0)
```