密度图用ggplot

时间:2017-06-04 19:31:19

标签: r ggplot2

我对数据集的可视化比较感兴趣:直方图和密度。我仅使用下面的数据集作为示例,但是这个想法是相同的,它用于泊松分布: 任何人都可以帮我用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)

1 个答案:

答案 0 :(得分:0)

可能不是很好,但例如:

.bind()
相关问题