However if you do:
ggplot(data=dafr, aes(x = d1, fill=d2)) + geom_histogram(binwidth = 1, position = position_dodge(width=0.99))
The position of first bin which goes from 0-2 appears to start at about 0.2 (I accept that there is some "white space" to the left of this) while the position of the last bin (16-18) appears to start at about 15.8, so the whole histogram seems to be wrongly compressed into the scale. In my real data which has potentially 250 bins the problem becomes much more pronounced. Has any one else noticed this? Is there a work around?