情节多分布在R图(暂停) - plot multiple distributions in one graph in R [on hold]

- 此内容更新于:2016-02-02
主题:

背景信息我相当新的r.我想情节很多poisson-distributions图。这是我最近的成功:问题是,它没有情节每个poisson-distributionsλ5到15。显然是有分布失踪。这段代码有什么问题。

原文:

For background info I am fairly new to R. I am trying to plot many poisson-distributions to one graph. This is the closest i've managed to get:

plot(0,0, xlim=c(0,20), ylim=c(0,1), type="n")
for (i in 5:15) {
  x <- rpois(1,i)
  lines(density(x,bw=1), lwd=1)
}

Problem with this is that it doesn't plot every poisson-distributions with lambda 5 to 15. There is clearly some distributions missing. What is wrong with this code.

网友:是一个值。这真的是你在寻找什么?

(原文:rpois(1,i) is one value. Is it really what you are looking for?)

网友:试着取代它

(原文:Try replacing it with rpois(10000,i))

网友:这个问题是由一个简单的印刷错误。投票结束。

(原文:This question was caused by a simple typographical error. Voted to close.)