- R 3.2.1
- RStudio版本0.99.473
- Macintosh;英特尔Mac OS X 10_9_4
单击更新软件包会弹出一个窗口,显示"R错误",然后在控制台中打印出错误:
Error in if (substr(cranRep, cranRepLen, cranRepLen) != "/") cranRep <-
paste(cranRep, :missing value where TRUE/FALSE needed
我确实有一个.R配置文件,用于启动。
深入研究Github,答案似乎是在.Rprofile中指定以下内容:
options(repos=c(CRAN="https://cran.rstudio.com/"))
与相反
options(repos="https://cran.rstudio.com/")
我遇到了同样的问题,即缺少TRUE/FALSE需要的值
R和RStudio版本- R Studio 1.0.143
- R 3.4.0
我通过编辑Rprofile.site解决了问题。以下是步骤:
步骤1:转到C:\Program Files\R\R-3.4.0\etc或Rprofile.site为的位置
第2步:打开Rprofile.site。并将"Set Cran mirror"编辑为
local({r <- getOption("repos")
r["CRAN"] <- "https://cran.rstudio.com/"
options(repos=r)})
步骤3:必要时重新启动RStudio