Is there an easy way to mark individual “blocks” in a “stacked” histogram, for example, the following. I would like the labels to be closer to the top of each block, but my last approach is that they somehow replace the texts for the USA and Mexico, as shown below.

Looking back at the solution, I only found approaches in which the y value for the text must be pre-computed from the outside, which, in addition to additional logic, leads to the problem of controlling the order in which the blocks are stacked ...
I also found this question https://stackoverflow.com/a/3126262/232832 where I got the idea of ​​using geom="text" in stat_bin (see code below)
Here is a snippet of code to illustrate my current approach. I'm not necessarily trying to fix this snippet, any common idiom for shortcuts to be displayed in bar charts! Edit: (in view of two answers this question has received so far)
I would like to emphasize that I would prefer solutions that do not involve a preliminary calculation of the y-position of the text .
# sample data source df.StackData <- data.frame( QType = c("A4-1", "A4-1", "A4-1", "B3", "B3", "B3"), Country = c("Canada", "USA", "Mexico", "Canada", "USA", "Mexico"), NbOfCases = c(1000, 1320, 380, 400, 1000, 812), AvgRate = c(17.2, 11.4, 44.21, 17.3, 15.3, 39.7), Comment = c("Can", "US", "Mex", "Can", "US", "Mex") )
and calling ggplot. It creates the graph shown above with an odd swap of labels (as well as an additional legend), although this problem with the legend is easy to take care of, I just noticed it when preparing this question).
ggplot(data=df.StackData, aes(x=QType, y=NbOfCases, fill=Country))+ geom_bar(stat="identity", width=1) + stat_bin(geom="text", aes(label=paste("R coef =", formatC(AvgRate, format="f", digits=3), "(", Comment, ")" ), vjust=1.5, size=3 ) )
My initial attempts added geom_text () to the graph as shown below, but of course the y value was wrong (the string texts are relative to the very bottom of the graph, and not this at the bottom of the individual blocks) ...
... + geom_text(mapping=aes(x=QType, y=NbOfCases, label=paste("R coef =", formatC(AvgRate, format="f", digits=3), "(", Comment, ")" ), vjust=1.5), size=3)