Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在医院防火墙后面,通常必须使用setInternet2(T)R 才能正确访问网络。但是运行我的代码(在家里完美运行)会导致
setInternet2(T)
curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : Could not resolve host: www.cnn.com; Host not found
有没有可能解决这个问题?
问候,
//M
看起来 RCurl 没有使用与 R 相同的代理设置(因此设置 internet2 没有帮助),您需要使用以下curlSetOpt命令手动设置它们:
curlSetOpt
curl <- getCurlHandle()
curlSetOpt(.opts = list(proxy = '<address>:<port>'), curl = curl)
ans <- getURL('http://www.cnn.com', curl = curl)