【发布时间】:2014-10-06 05:26:11
【问题描述】:
今天我对 R 中的函数 'slider' 有某种问题(使用 R studio 3.1.1)。 这是错误的文本:
滑块错误(62, 74, step = 0.5):未使用的参数(step = 0.5)
我正在尝试在没有此参数的情况下使用此函数,但它显示了一个新错误:
tclVar(sl.defaults[i]) 中的错误:
参数“sl.defaults”丢失,没有默认值
然后送我去回溯! 哪里出了问题?
附言这是我的代码:
library(manipulate)
library(UsingR)
data(galton)
myHist <- function(mu) {
hist(galton$child, col = "red", breaks = 100)
lines(c(mu, mu), c(0, 150), col = "green", lwd = 5)
mse <- mean((galton$child - mu)^2)
text(63, 150, paste("mu = ", mu))
text(63, 150, paste("MSE = ", round(mse, 2)))
}
manipulate(myHist(mu), mu = slider(62, 74, step = 1))
【问题讨论】:
标签: r compiler-errors syntax-error