0

I'm trying to connect R from behind a proxy server.

I've tried various versions of feeding the proxy, port, user, pass to R with no luck including this example here.

Here's my code and results:

> opts <- list(
+   proxy         = "1111.2222.3333.4444", 
+   proxyusername = "sss\\user", 
+   proxypassword = "pass", 
+   proxyport     = 8080
+ )
> http_proxy=opts 
> install.packages("randomForest")
Installing package(s) into ‘C:/Users/~/Documents/R/win-library/2.14’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---

> 

It then freezes and does nothing.

Any suggestions?

Also, are there any special issues if the username has a \ in it?

Community
  • 1
  • 1
screechOwl
  • 27,310
  • 61
  • 158
  • 267

2 Answers2

1

http_proxy = opts is not how to do this in R, this is an environment variable for your operating system.

See ?download.file for a number of options, and (fwiw) the stackoverflow question that you already referred to above.

mdsumner
  • 29,099
  • 6
  • 83
  • 91
1

If you are using Windows you can set it up by defining the proxy in Internet Explorer and add --internet2 to the R startup shortcut (or add setInternet2(TRUE) to R\etc\RProfile.site) and then it uses the system wide settings.

If on Windows have you tried this? If not on Windows which OS are you using?

Hansi
  • 2,566
  • 1
  • 15
  • 19