在RStudio中更新软件包无法工作

3
  • R 3.2.1
  • RStudio 0.99.473版本
  • Macintosh; Intel Mac OS X 10_9_4操作系统

点击“更新包”后会弹出一个窗口,显示“R错误”,并在控制台中输出错误信息:

Error in if (substr(cranRep, cranRepLen, cranRepLen) != "/") cranRep <- 
paste(cranRep,  :missing value where TRUE/FALSE needed

我有一个 .Rprofile 文件,用于启动时使用。

2个回答

4
通过对Github进行一些挖掘, 答案似乎是在 .Rprofile 中指定以下内容:
options(repos=c(CRAN="https://cran.rstudio.com/"))

与之相对
options(repos="https://cran.rstudio.com/")

0

我遇到了同样的问题,即需要TRUE/FALSE的缺失值

R和RStudio版本
  • R Studio 1.0.143
  • R 3.4.0

我通过编辑Rprofile.site解决了这个问题。以下是步骤:

第一步: 转到C:\Program Files\R\R-3.4.0\etc或Rprofile.site所在位置

第二步: 打开Rprofile.site。并将“设置Cran镜像”更改为

    local({r <- getOption("repos")
    r["CRAN"] <- "https://cran.rstudio.com/"
    options(repos=r)})

步骤3: 如有必要,请重新启动RStudio


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接