我是一个Windows用户。几周前,我安装了R和Rstudio以及许多软件包。今天有一条消息说没有安装新的包。
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/src/contrib:
cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES'我重新安装了R,但这并没有解决问题。
install.packages中的警告:
InternetOpenUrl failed: 'Can not connect to server'发布于 2017-07-16 23:31:55
在session修复错误的同时,为了避免每次启动R会话时都指定CRAN存储库,一个临时解决方案是编辑"Rprofile.site“文件并添加以下代码行
options(repos = getOption("repos")["CRAN"])
这样,每次启动R会话时,CRANextra存储库("http://www.stats.ox.ac.uk/pub/RWin")都会自动删除。只需记住在bug解决后删除或注释# this行即可。
发布于 2020-09-13 00:01:21
我也遇到过类似的问题,对我有效的修复方法是,在RStudio中,我打开了tools ->全局选项-> Packages ->主CRAN存储库-> Set Global。
另外,要确保你没有使用installed.packages,因为RStudio类型的建议,很多人都会遇到这种情况。您需要使用install.packages("")
https://stackoverflow.com/questions/45115975
复制相似问题