相关疑难解决方法(0)

如何告诉R解释器如何使用代理服务器?

我试图让R(在Windows上运行)从Internet下载一些软件包,但下载失败,因为我无法正确使用必要的代理服务器.当我尝试Windows菜单选项Packages > Install package(s)...并选择一个CRAN镜像时的输出文本是:

> utils:::menuInstallPkgs()
--- Please select a CRAN mirror for use in this session ---
Warning: unable to access index for repository http://cran.opensourceresources.org/bin/windows/contrib/2.12
Warning: unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.12
Error in install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) :
    no packages were specified
In addition: Warning message:
In open.connection(con, "r") :
    cannot open: HTTP status was '407 Proxy Authentication Required'

我知道代理的地址和端口,我也知道自动配置脚本的地址.我不知道调用了什么身份验证,但是当使用代理时(在浏览器和其他一些应用程序中),我会在弹出的对话框窗口中输入用户名和密码.

要设置代理,我尝试了以下各项:

  • Sys.setenv(http_proxy="http://proxy.example.com:8080")
  • Sys.setenv("http_proxy"="http://proxy.example.com:8080")
  • Sys.setenv(HTTP_PROXY="http://proxy.example.com:8080")
  • Sys.setenv("HTTP_PROXY"="http://proxy.example.com:8080")

对于身份验证,我同样尝试将http_proxy_user环境变量设置为:

  • ask …

proxy r

21
推荐指数
1
解决办法
2万
查看次数

在R中安装任何软件包时出错/警告

突然我在R中安装任何软件包时开始出现以下错误/警告

> utils:::menuInstallPkgs()
Warning: unable to access index for repository     
http://ftp.iitm.ac.in/cran/bin/windows/contrib/3.0
Warning: unable to access index for repository   
http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.0
Error in install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) : 
no packages were specified
Run Code Online (Sandbox Code Playgroud)

我尝试了两种方法.我试过从http://cran.r-project.org/web/packages/rjson/index.html下载"rjson"软件包--->从菜单中选择CRAN镜像然后安装软件包下载二进制zip文件...在此之后我得到上述错误.

我也试过install.packages("anypackage")现在我收到以下错误

Installing package into ‘C:/Users/ayush/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository   
http://ftp.iitm.ac.in/cran/bin/windows/contrib/3.0
Warning: unable to access index for repository   
http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.0
Warning message:
package ‘rjson’ is not available (for R version 3.0.1)
Run Code Online (Sandbox Code Playgroud)

我也试过改变CRAN镜子.但没有运气.

我之前也提到过这个问题,从R Forge安装包装时出现安装错误,我已经尝试了所提到的可能的解决方案.但不行. …

r package cran

5
推荐指数
0
解决办法
222
查看次数

标签 统计

r ×2

cran ×1

package ×1

proxy ×1