UPDATE
comma() is now superseded by label_number().
The syntax is a bit different. There is no x argument as before. The label_ creates a function then the after_stat is feeded to it.
Using the exemple by @stefan it would be:
library(ggplot2)
ggplot(mpg, aes(x = class)) +
geom_bar(fill = '#00798c') +
geom_text(stat = "count",
aes(label = scales::label_number(scale = 1000, big.mark = ",")(after_stat(count))),
position = position_dodge(width = 0.8),
vjust = -.3, fontface = "bold")