The function commais in the package scalesyou need to download. Also get rid of sepwhat is not an aesthetic display. This should work:
library(scales)
ggplot(based,aes(x=Cust=Claim.USD)) +
geom_boxplot() +
geom_text(data=subset(based,USD>10000), aes(label = comma(USD)),
hjust=1, vjust=1)+
scale_y_continuous(labels = comma)
Judging by your argument names, you might prefer scales::dollarinstead scales::comma.
source
share