我在办公室与网络连接R时面临问题.可能是由于局域网设置.我尝试了网上遇到的几乎所有可能的方式(见下文),但仍然徒劳无功.
方法1:使用调用R --internet2
方法2:通过设置调用R. ~/Rgui.exe http_proxy=http:/999.99.99.99:8080/ http_proxy_user=ask
方法3:设置 Setinternet2=TRUE
方法4:
curl <- getCurlHandle()
curlSetOpt(.opts = list(proxy = '999.99.99.99:8080'), curl = curl)
Res <- getURL('http://www.cricinfo.com', curl = curl)
Run Code Online (Sandbox Code Playgroud)在上述所有方法中,我都可以直接从CRAN加载包,也可以使用download.file命令下载文件
但是,使用getURL(RCurl),readHTMLTable(XML),htmlTreeParse(XML)命令我无法提取网页的数据.我收到了~<HEAD>\n<TITLE>Access Denied</TITLE>\n</HEAD>~错误.
如何在R中设置XML包的LAN代理设置?
有没有办法从网上获取R脚本?
例如 source('http://github.com/project/R/file.r')
原因:我目前有一个项目,我想提供使用但尚未准备好进行打包.因此,给人们一个单一的文件来源于网络(然后将来源所有单独的功能文件)会很棒.
仔细观察,问题似乎是https.我该如何获取此文件?
https://raw.github.com/hadley/stringr/master/R/c.r
Run Code Online (Sandbox Code Playgroud) 我正在尝试下载动物园包以使用时间序列:
install.packages("zoo")
Run Code Online (Sandbox Code Playgroud)
但我收到以下消息:
--- Please select a CRAN mirror for use in this session ---
Warning: unable to access index for repository http://cran.cnr.Berkeley.edu/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
Warning messages:
1: In open.connection(con, "r") :
unable to connect to 'cran.r-project.org' on port 80.
2: In getDependencies(pkgs, dependencies, available, lib) :
package ‘zoo’ is not available
Run Code Online (Sandbox Code Playgroud)
我尝试了几个不同的镜子,并且我一直得到同样的错误......动物园在大多数镜子中都没有,或者出了什么问题?