【发布时间】:2025-12-14 11:25:01
【问题描述】:
我的目标是使用参数type="s" 生成由步骤组成的累积分布函数,但是当我尝试例如时
plot(ecdf(rgeom(0:40,0.3)), type="s")
它说错误
Error in plot.default(NA, NA, type = "n", xlim = xlim, ylim = ylim, xlab = xlab, : formal argument "type" matched by multiple actual arguments
怎么办?
【问题讨论】:
-
ecdf有自己的绘图方法;见?plot.ecdf。随意调整,例如plot(ecdf(rgeom(0:40,0.3)), verticals = TRUE, pch = NA, col.01line = NA) -
试试这个
curve(ecdf(rgeom(0:40,0.3))(x), from = 0, to = 40, type = "s")
标签: r plot types frequency-distribution