Setting up the proxy for rstudio

My machine is running on Ubuntu 14.04, and I have already tried looking at Configuring R to Use an HTTP Proxy in the FAQ section of Rstudio support.

This is what I did till now...

in my home directory, I created a file named .Renviron with the following contents

http_proxy = http:// ip_address : port_num/
http_proxy_user = username : password

then in the rstudio, I tried to install swirl package

> install.packages("swirl")
Warning in install.packages :
  cannot open: HTTP status was '403 Forbidden'
Warning in install.packages :
  cannot open: HTTP status was '403 Forbidden'
Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/src/contrib
Installing package into ‘/home/dmacs/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
  cannot open: HTTP status was '403 Forbidden'
Warning in install.packages :
  cannot open: HTTP status was '403 Forbidden'
Warning in install.packages :
  unable to access index for repository http://cran.rstudio.com/src/contrib
Warning in install.packages :
  package ‘swirl’ is not available (for R version 3.1.2)

and there I see all this stuff, but I am able to access the link http://cran.rstudio.com/src/contrib from my browser.

I even tried setting up the proxy using GUI based rstudio, but I couldn't figure out where was the option to set the proxy.

enter image description here

Thanks in advance.


Swaroop

You should add proxy information to your Renviron.site file that is located ‘R_HOME/etc/Renviron.site’. You can find your R_HOME by call bellow command on RStudio console.

> R.home()
[1] "/usr/lib/R"

Add you proxy server address in ‘R_HOME/etc/Renviron.site’

http_proxy=http://<<your proxy server address>>/

and restart RStudio.

Good luck.

Ky Ryu