seq.int中的错误(from,to,length.out = n):'from'必须是有限数

时间:2018-02-19 16:21:12

标签: r

我一直收到此错误"Error in seq.int(from, to, length.out = n) : 'from' must be a finite number."我在下面发布了我的代码。

 p <- seq(0, 1, .01)    
qnorm(p, mean=0, sd=1)
qcauchy(p, location = 0, scale = 1)
plot(qnorm, qcauchy, main = "Normal-Cauchy", xlab="normal", ylab = "cauchy")

1 个答案:

答案 0 :(得分:0)

您需要存储来自qnorm()qcauchy()的对象。尝试:

p <- seq(0, 1, .01)
q1 <- qnorm(p, mean = 0, sd = 1)
q2 <- qcauchy(p, location = 0, scale = 1)
plot(q1, q2, main = "Normal-Cauchy", xlab = "Normal", ylab = "Cauchy")