I am interested in comparison of visualization of dataset: histogram and density. I used dataset below for example only, however the idea is the same and it is for Poisson distribution: Could anyone help me to plot display this with ggplot2?
example <- read.csv(file=url('http://www.math.uah.edu/stat/data/HorseKicks.csv'),header=T)
summary(example)
hist(example$C14,prob=T)
summary(glm(C14~1,family=poisson(link='log'),data=example))
lines(x=0:4,y=dpois(0:4,lambda=exp(0.1823)),col='red',lwd=1)