xs <- seq(floor(min(fheight)),ceiling(max(fheight)),0.01)
plot(xs, ecdf(fheight)(xs),type = "l", xlab = "height in inches",ylab = "F(x)")ecdf(fheight)(xs)中(xs)的用途是什么
发布于 2020-05-13 14:16:53
ecdf(fheight)返回一个函数。是的,有一个带参数的函数来返回另一个函数,这有点奇怪。
xs是结果函数的参数。
因此,ecdf(fheight)(xs)将返回累积密度函数ecdf(fheight)在xs值时的值。
从?ecdf提供的R帮助中,您可以看到以下内容:
Value
对于ecdf,"ecdf"类的函数
https://stackoverflow.com/questions/61767516
复制相似问题