Inspired by this question
Apparantly, there is some of way to calculate groupwise percentages in histograms using special variables like "..count.." and "..group.."
Example from link:
ggplot(data, aes(carat, fill=color)) +
geom_histogram(aes(y=c(..count..[..group..==1]/sum(..count..[..group..==1]),
..count..[..group..==2]/sum(..count..[..group..==2]))*100),
position='dodge', binwidth=0.5) +
ylab("Percentage") + xlab("Carat")
Is there any place I can read about these special variables and how they function/interact? My google searches have come up short and I have not been able to find anything through the apropos-command.