GetURL in RCurl issue behind R firewall

I am behind a hospital firewall and usually have to use setInternet2(T)for R in order to access the network properly. However, running my code (which works great at home) leads to

curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : 
  Could not resolve host: www.cnn.com; Host not found

Is there any way around this?

Yours faithfully,

// M

+3
source share
1 answer

It seems that RCURL does not use the same proxy settings as R (and therefore the internet2 setting does not help), you need to install them manually using the command curlSetOpt:

curl <- getCurlHandle()

curlSetOpt(.opts = list(proxy = '<address>:<port>'), curl = curl)

ans <- getURL('http://www.cnn.com', curl = curl)

+2
source

Source: https://habr.com/ru/post/1774900/


All Articles