我无法通过RStudio and R Version.3.1.1.Kindly帮助的最新版本安装软件包.我得到了如下所述的错误:
Example:
Warning in install.packages :
InternetOpenUrl failed: ''
Warning in install.packages :
InternetOpenUrl failed: ''
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.1
Installing package into ‘C:/Users/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
InternetOpenUrl failed: ''
Warning in install.packages :
InternetOpenUrl failed: ''
Warning in install.packages :
unable to access index for repository http://cran.rstudio.com/bin/windows/contrib/3.1
Warning in install.packages :
package ‘reshape’ is not available (for R version 3.1.1)
Run Code Online (Sandbox Code Playgroud)
cer*_*cer 135
不是100%肯定你有同样的问题,但我发现我的工作阻止提供的每个镜像站点选项的困难方式,我得到这样的错误:
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Error in download.file(url, destfile = f, quiet = TRUE) :
unsupported URL scheme
Warning: unable to access index for repository https://rweb.crmda.ku.edu/cran/src/contrib
Warning message:
package ‘ggplot2’ is not available (for R version 3.2.2)
Run Code Online (Sandbox Code Playgroud)
解决方法(我正在使用CentOS)...
install.packages('package_name', dependencies=TRUE, repos='http://cran.rstudio.com/')
Run Code Online (Sandbox Code Playgroud)
我希望这能节省数小时的挫折感.
rba*_*att 68
我认为这是"设置并忘记它"的解决方案:
options(repos='http://cran.rstudio.com/')
Run Code Online (Sandbox Code Playgroud)
请注意,这不是https.我在Linux机器上,ssh'ing.如果我使用https,它不起作用.
正如@Pascal所说,您可能遇到防火墙或/和代理问题.首先,请浏览CRAN网页上的常见问题解答.在此之后,尝试R标志与--internet2.
有时,检查R studio中的全局选项并取消选中"使用Internet Explorer库/代理HTTP"可能很有用.工具 - >全局选项 - >打包并取消选中"使用Internet Explorer库/代理进行HTTP"选项.
希望这可以帮助.
根据社区的答案,似乎有几种方法可以解决这个问题:
在Windows上,您可以启动应用程序http_proxy=http://host:port/:
"C:\Program Files\RStudio\bin\rstudio.exe" http_proxy=http://host:port/关机并重启.经过上述许多操作后需要,并建议单独使用.