If you post your data, I'll amend this answer using it. But basically you want
df %>%
count(x, y) %>%
ggplot(aes(x = x, y = n, fill = y)) +
geom_col() +
geom_text(aes(label = x), data = . %>% filter(x >= thresh), vjust = 0, nudge_y = 0.1)
where thresh
is some threshold you've set--maybe an arbitrary cutoff point that makes sense, or maybe 3 standard deviations from the mean of x, or whatever. You can store it in an outside variable, you can make a boolean column in your dataframe, or you can calculate it inline inside your geom_text
--really up to you. vjust = 0, nudge_y = 0.1
puts the labels just above the bars corresponding to your outliers.