As I need to use ggplot2 in a function, non standard evaluation mode is required. Therefore, aes_string
with "price"
is used. However, then ..count..
no longer is defined
ggplot(diamonds, aes_string(x="price", ..count../sum(..count..))) + geom_histogram(binwidth = 500)