【问题标题】:R; Using manipulate function and get : Error in (function (x) : unused argument (envir = <environment>)R;使用操作函数并获取:(函数(x)中的错误:未使用的参数(环境= <环境>)
【发布时间】:2016-01-27 14:07:22
【问题描述】:

我打算用manipulate:

    install.packages("UsingR")
    library(manipulate)
    library(UsingR)

    data(galton)

    ########## Manipulable Histogram ##########

    myHist <- function(mu, Color){
    hist(galton$child, col=Color, breaks=10)
    lines(c(mu,mu), c(0, 150), col="red", lwd=5)
    }

    manipulate(myHist(mu, Color), mu = slider(62, 74, step=.5),
    Color=picker("blue", "red", initial="blue"))

我在使用操作时总是收到此错误:

(函数 (x) 中的错误:未使用的参数 (envir = )

我在上面的代码中没有看到任何问题。我不知道为什么会出现此错误。我的 R 会话是干净的和新的。

我正在使用R3.2 64 bitsR Studio Version 0.99.441。 知道缺少的设置吗?

【问题讨论】:

    标签: r environment


    【解决方案1】:

    通过将 Rstudio 中的“R”目录设置为我的默认工作目录,文件夹 win-library 所在的位置,找到了答案。

    【讨论】:

      猜你喜欢
      • 2019-06-09
      • 1970-01-01
      • 2019-03-22
      • 1970-01-01
      • 2014-07-16
      • 2021-08-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多